Merge branch 'KenWillmott-master'
This commit is contained in:
commit
083e98801d
|
@ -168,8 +168,10 @@ uint32 rtc_get_count() {
|
|||
rtc_clear_sync();
|
||||
rtc_wait_sync();
|
||||
rtc_wait_finished();
|
||||
h = RTC->regs->CNTH & 0xffff;
|
||||
l = RTC->regs->CNTL & 0xffff;
|
||||
do {
|
||||
h = RTC->regs->CNTH & 0xffff;
|
||||
l = RTC->regs->CNTL & 0xffff;
|
||||
} while (h != (RTC->regs->CNTH & 0xffff));
|
||||
return (h << 16) | l;
|
||||
}
|
||||
|
||||
|
@ -182,10 +184,8 @@ void rtc_set_count(uint32 value) {
|
|||
rtc_wait_sync();
|
||||
rtc_wait_finished();
|
||||
rtc_enter_config_mode();
|
||||
do {
|
||||
h = RTC->regs->CNTH & 0xffff;
|
||||
l = RTC->regs->CNTL & 0xffff;
|
||||
} while (h ^ (RTC->regs->CNTH & 0xffff));
|
||||
RTC->regs->CNTH = (value >> 16) & 0xffff;
|
||||
RTC->regs->CNTL = value & 0xffff;
|
||||
rtc_exit_config_mode();
|
||||
rtc_wait_finished();
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ uint32 rtc_get_divider() {
|
|||
do {
|
||||
h = RTC->regs->DIVH & 0x000f;
|
||||
l = RTC->regs->DIVL & 0xffff;
|
||||
} while (h ^ (RTC->regs->DIVH & 0x000f));
|
||||
} while (h != (RTC->regs->DIVH & 0x000f));
|
||||
return (h << 16) | l;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue