diff options
Diffstat (limited to 'firmware/drivers')
-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) | |||
99 | seconds >>= 8; | 99 | seconds >>= 8; |
100 | seconds |= 1<<7; /* enable bit */ | 100 | seconds |= 1<<7; /* enable bit */ |
101 | ascodec_write(AS3543_WAKEUP, seconds); | 101 | ascodec_write(AS3543_WAKEUP, seconds); |
102 | |||
103 | /* write 0x80 to prevent the OF refreshing its database from the microSD */ | ||
104 | ascodec_write(AS3543_WAKEUP, 0x80); | ||
102 | 105 | ||
103 | /* write our desired time of wake up to detect power-up from RTC */ | 106 | /* write our desired time of wake up to detect power-up from RTC */ |
104 | ascodec_write(AS3543_WAKEUP, wakeup_h); | 107 | ascodec_write(AS3543_WAKEUP, wakeup_h); |
@@ -127,6 +130,9 @@ bool rtc_check_alarm_started(bool release_alarm) | |||
127 | ascodec_read(AS3543_WAKEUP); /* bits 15:8 */ | 130 | ascodec_read(AS3543_WAKEUP); /* bits 15:8 */ |
128 | if(!(ascodec_read(AS3543_WAKEUP) & (1<<7))) /* enable bit */ | 131 | if(!(ascodec_read(AS3543_WAKEUP) & (1<<7))) /* enable bit */ |
129 | return false; | 132 | return false; |
133 | |||
134 | /* skip WAKEUP[3] which the OF uses for other purposes */ | ||
135 | ascodec_read(AS3543_WAKEUP); | ||
130 | 136 | ||
131 | /* subsequent reads give the 16 bytes static SRAM */ | 137 | /* subsequent reads give the 16 bytes static SRAM */ |
132 | wakeup_h = ascodec_read(AS3543_WAKEUP); | 138 | wakeup_h = ascodec_read(AS3543_WAKEUP); |