andysworkshop / stm32plus

The C++ library for the STM32 F0, F100, F103, F107 and F4 microcontrollers
http://www.andybrown.me.uk
Other
745 stars 224 forks source link

reset RTC if time not set #197

Closed dholth closed 7 years ago

dholth commented 7 years ago

I ran into this in my own project. The LSE did not have enough load capacitance, and the RTC was stuck at zero (couldn't find a good way to set the backup value after the actual LSE init). Maybe checking to see if the time is nonzero is more useful than having a magic value.

Also noticed a place where _hourFormat is used without accounting for the masking used to store survived flag.