diff options
Diffstat (limited to 'firmware/drivers/rtc/rtc_as3514.c')
-rw-r--r-- | firmware/drivers/rtc/rtc_as3514.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/drivers/rtc/rtc_as3514.c b/firmware/drivers/rtc/rtc_as3514.c index f2716e52e8..81137bda14 100644 --- a/firmware/drivers/rtc/rtc_as3514.c +++ b/firmware/drivers/rtc/rtc_as3514.c @@ -99,6 +99,9 @@ void rtc_alarm_poweroff(void) seconds >>= 8; seconds |= 1<<7; /* enable bit */ ascodec_write(AS3543_WAKEUP, seconds); + + /* write 0x80 to prevent the OF refreshing its database from the microSD */ + ascodec_write(AS3543_WAKEUP, 0x80); /* write our desired time of wake up to detect power-up from RTC */ ascodec_write(AS3543_WAKEUP, wakeup_h); @@ -127,6 +130,9 @@ bool rtc_check_alarm_started(bool release_alarm) ascodec_read(AS3543_WAKEUP); /* bits 15:8 */ if(!(ascodec_read(AS3543_WAKEUP) & (1<<7))) /* enable bit */ return false; + + /* skip WAKEUP[3] which the OF uses for other purposes */ + ascodec_read(AS3543_WAKEUP); /* subsequent reads give the 16 bytes static SRAM */ wakeup_h = ascodec_read(AS3543_WAKEUP); |