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
stm32/ADC: Fix prescaler calculation to include MAX frequency.
Due to the integer rounding rules one has to subtract 1 from the numerator.
For example:
Let max clock be 55 and supplied clock be 110
110/55 = 2 which results in the divider being set to 4 and the clock after division ends up being 27 instead of 55
Subtracting 1 to the numerator get around the rounding issue
109/55 = 1 which results in the divider being set to 2 and the clock after division ends up being 55 which is exactly max clock
Copy file name to clipboardExpand all lines: embassy-stm32/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
31
31
- feat: stm32/usart: add `eager_reads` option to control if buffered readers return as soon as possible or after more data is available ([#4668](https://github.com/embassy-rs/embassy/pull/4668))
32
32
- feat: stm32/usart: add `de_assertion_time` and `de_deassertion_time` config options
33
33
- change: stm32/uart: BufferedUartRx now returns all available bytes from the internal buffer
34
+
- fix: Calculate the ADC prescaler in a way that it allows for the max frequency to be reached
0 commit comments