fixing pre-commit stuff

This commit is contained in:
Max Holliday 2021-10-10 16:40:00 -07:00
parent e136cbd007
commit e7324fa7c3
2 changed files with 3 additions and 3 deletions

View File

@ -69,7 +69,7 @@ samd_sleep_source_t alarm_get_wakeup_cause(void) {
} }
if (!fake_sleep && RSTC->RCAUSE.bit.BACKUP) { if (!fake_sleep && RSTC->RCAUSE.bit.BACKUP) {
// This is checked during rtc_init to cache TAMPID if necessary // This is checked during rtc_init to cache TAMPID if necessary
if (pin_wake ||RTC->MODE0.TAMPID.reg) { if (pin_wake || RTC->MODE0.TAMPID.reg) {
pin_wake = true; pin_wake = true;
return SAMD_WAKEUP_GPIO; return SAMD_WAKEUP_GPIO;
} }

View File

@ -81,7 +81,7 @@ void time_alarm_callback(void) {
} }
bool alarm_time_timealarm_woke_this_cycle(void) { bool alarm_time_timealarm_woke_this_cycle(void) {
if (timealarm_on && (((uint32_t)port_get_raw_ticks(NULL)<<4) > RTC->MODE0.COMP[1].reg)) { if (timealarm_on && (((uint32_t)port_get_raw_ticks(NULL) << 4) > RTC->MODE0.COMP[1].reg)) {
woke_up = true; woke_up = true;
} }
return woke_up; return woke_up;
@ -129,7 +129,7 @@ void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_
timealarm_on = true; timealarm_on = true;
// Set COMP1 for fake sleep. This will be read and reset for real deep sleep anyways. // Set COMP1 for fake sleep. This will be read and reset for real deep sleep anyways.
// RTC->MODE0.COMP[1].reg = wakeup_in_ticks; // RTC->MODE0.COMP[1].reg = wakeup_in_ticks;
RTC->MODE0.COMP[1].reg = ((uint32_t)port_get_raw_ticks(NULL)+wakeup_in_ticks)<<4; RTC->MODE0.COMP[1].reg = ((uint32_t)port_get_raw_ticks(NULL) + wakeup_in_ticks) << 4;
while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COMP1)) != 0) { while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COMP1)) != 0) {
} }
RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP1; RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP1;