forked from len0rd/rockbox
Sansa clip+: prevent an unnecessary OF database refresh when using the wake-up alarm with a uSD card inserted (probably works for other AMSv2 targets too)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27158 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
99517d6319
commit
9e86287946
1 changed files with 6 additions and 0 deletions
|
|
@ -100,6 +100,9 @@ void rtc_alarm_poweroff(void)
|
||||||
seconds |= 1<<7; /* enable bit */
|
seconds |= 1<<7; /* enable bit */
|
||||||
ascodec_write(AS3543_WAKEUP, seconds);
|
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 */
|
/* write our desired time of wake up to detect power-up from RTC */
|
||||||
ascodec_write(AS3543_WAKEUP, wakeup_h);
|
ascodec_write(AS3543_WAKEUP, wakeup_h);
|
||||||
ascodec_write(AS3543_WAKEUP, wakeup_m);
|
ascodec_write(AS3543_WAKEUP, wakeup_m);
|
||||||
|
|
@ -128,6 +131,9 @@ bool rtc_check_alarm_started(bool release_alarm)
|
||||||
if(!(ascodec_read(AS3543_WAKEUP) & (1<<7))) /* enable bit */
|
if(!(ascodec_read(AS3543_WAKEUP) & (1<<7))) /* enable bit */
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* skip WAKEUP[3] which the OF uses for other purposes */
|
||||||
|
ascodec_read(AS3543_WAKEUP);
|
||||||
|
|
||||||
/* subsequent reads give the 16 bytes static SRAM */
|
/* subsequent reads give the 16 bytes static SRAM */
|
||||||
wakeup_h = ascodec_read(AS3543_WAKEUP);
|
wakeup_h = ascodec_read(AS3543_WAKEUP);
|
||||||
wakeup_m = ascodec_read(AS3543_WAKEUP);
|
wakeup_m = ascodec_read(AS3543_WAKEUP);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue