[ClockUtils] Fixed getAPBFrequency
This is a merge request for a clear branch for the fixes object of this closed merge request. The following description is the same of the linked merge request.
Fixes applied:
- Created two different functions: one for retrieving the clock frequency of timers on a particular APB, the other for peripherals.
- Fixed the disabling of TIM3 clock
Explaination of the bug found in getAPBFrequency
:
Checking the ClockUtils
framework we found out that the frequency returned by the getAPBFrequency
method was relative to the timers branch, that includes also a multiplier by 2 if the prescaler on the relative APB is active. Threads regarding the previous wrong usages of getAPBFrequency
have been opened and these are substituted with the pre-compatible getAPBFrequencyTimers
function. They must be changed in order to use the correct method.