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.
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.