[LL][TIM] Update __LL_TIM_CALC_PSC() macro to round up the evaluate value when the fractional part of the division is greater than 0.5
diff --git a/Inc/stm32f3xx_ll_tim.h b/Inc/stm32f3xx_ll_tim.h index 2e76081..7c9cffe 100644 --- a/Inc/stm32f3xx_ll_tim.h +++ b/Inc/stm32f3xx_ll_tim.h
@@ -1335,7 +1335,7 @@ * @retval Prescaler value (between Min_Data=0 and Max_Data=65535) */ #define __LL_TIM_CALC_PSC(__TIMCLK__, __CNTCLK__) \ - (((__TIMCLK__) >= (__CNTCLK__)) ? (uint32_t)(((__TIMCLK__)/(__CNTCLK__)) - 1U) : 0U) + (((__TIMCLK__) >= (__CNTCLK__)) ? (uint32_t)((((__TIMCLK__) + (__CNTCLK__)/2U)/(__CNTCLK__)) - 1U) : 0U) /** * @brief HELPER macro calculating the auto-reload value to achieve the required output signal frequency.