You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
434: Fix computation of timer frequency r=burrbull a=SnVIZQ
Retrieving timer frequency using PwmHz::get_period() function can cause
division by zero exception for certain types of frequencies which are
configured by having zero in any of the PSC or ARR register - current
implementation uses "clk / (psc * arr)" expression to compute the
frequency.
Implementation of compute_arr_presc() sets PSC and ARR registers
correctly. Performing inverse computation leads to different expression:
"clk / ((psc + 1) * (arr + 1))" which properly computes timer frequency
from PSC and ARR registers. This patch uses new/fixed expression for
computing timer frequency.
Change log was modified.
Co-authored-by: Juraj Hercek <snvizq@hck.sk>
0 commit comments