Fix initial RTC config
This commit is contained in:
parent
fa4f717051
commit
8387226298
1 changed files with 1 additions and 1 deletions
2
main.c
2
main.c
|
|
@ -67,7 +67,6 @@ void rtc_alarm_reset(void) {
|
|||
}
|
||||
|
||||
void rtc_init(void) {
|
||||
rtc_bus_sync();
|
||||
RTC->CRH = 0;
|
||||
if (((RTC_INITIALIZED_REGISTER_HIGH<<16) | RTC_INITIALIZED_REGISTER_LOW) != COMPILE_TIME) {
|
||||
RCC->BDCR = RCC_BDCR_RTCEN | (1<<RCC_BDCR_RTCSEL_Pos) | RCC_BDCR_LSEON;
|
||||
|
|
@ -79,6 +78,7 @@ void rtc_init(void) {
|
|||
RTC_INITIALIZED_REGISTER_LOW = COMPILE_TIME&0xffff;
|
||||
REBOOT_REGISTER = 0;
|
||||
}
|
||||
rtc_bus_sync();
|
||||
}
|
||||
|
||||
void rtc_set_alarm_sec(uint32_t value) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue