forked from len0rd/rockbox
Gigabeat S:
1) Rework event handling and static registration mechanism. No target-
specific code in mc13783 driver. GPIO event driver interfaces more
cleanly.
2) Somewhat related - enable thread priority for bootloader which is
desireable here (ffs is used for GPIO event enabling anyway and that
goes along with priority).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17593 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5f796087b0
commit
a9c20f5789
19 changed files with 443 additions and 235 deletions
|
|
@ -67,11 +67,6 @@ enum rtc_registers_indexes
|
|||
/* was it an alarm that triggered power on ? */
|
||||
static bool alarm_start = false;
|
||||
|
||||
void mc13783_alarm_start(void)
|
||||
{
|
||||
alarm_start = true;
|
||||
}
|
||||
|
||||
static const unsigned char rtc_registers[RTC_NUM_REGS] =
|
||||
{
|
||||
[RTC_REG_TIME] = MC13783_RTC_TIME,
|
||||
|
|
@ -122,7 +117,12 @@ static int is_leap_year(int y)
|
|||
/** Public APIs **/
|
||||
void rtc_init(void)
|
||||
{
|
||||
/* Nothing to do */
|
||||
/* only needs to be polled on startup */
|
||||
if (mc13783_read(MC13783_INTERRUPT_STATUS1) & MC13783_TODAI)
|
||||
{
|
||||
alarm_start = true;
|
||||
mc13783_write(MC13783_INTERRUPT_STATUS1, MC13783_TODAI);
|
||||
}
|
||||
}
|
||||
|
||||
int rtc_read_datetime(unsigned char* buf)
|
||||
|
|
@ -264,7 +264,9 @@ bool rtc_enable_alarm(bool enable)
|
|||
bool rtc_check_alarm_started(bool release_alarm)
|
||||
{
|
||||
bool rc = alarm_start;
|
||||
alarm_start &= ~release_alarm;
|
||||
|
||||
if (release_alarm)
|
||||
alarm_start = false;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue