Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stm32/timer: avoid max_compare_value >= u16::MAX #3549

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Nov 20, 2024

  1. stm32/timer: avoid max_compare_value >= u16::MAX

    With STM32 32 bits timers, the max_compare_value (AKA, ARR register)
    can currently be set greater than u16::MAX, which leads to the following
    assert!(max < u16::MAX as u32) in max_duty_cycle() when setting up a 1 kHz
    SimplePwm on 84 MHz MCU.
    
    The issue is fixed by forcing a max_compare_value that fits into 16 bits
    when setting the frequency for a PWM.
    aurelj committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    3402e76 View commit details
    Browse the repository at this point in the history