-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make RTC prescaler uint32 #520
Comments
Can you do a PR for this? |
BTW. already takes 32 bits and seems to send write it into 2 separate registers in 16 bit chunks Arduino_STM32/STM32F1/libraries/RTClock/src/utility/rtc_util.c Lines 197 to 206 in 083e988
|
Yeah, I totally agree. I will make a PR, I already have made the changes locally. |
@rogerclarkmelbourne Please take a look. |
The RTC prescaler register allows 20 bits wide values to be written, whereas RTClock library uses
uint16
for prescaler argument:Arduino_STM32/STM32F1/libraries/RTClock/src/RTClock.h
Line 44 in 8fa6bb4
My device has 12 MHz crystal. The prescaler should be 93749 (12000000/128) in my case, but it won't fit into
uint16
argument.The underlying
rtc_set_prescaler_load
function, which is used internally, already usesuint32
argument.Please update the library to use
uint32
instead.The text was updated successfully, but these errors were encountered: