kopia lustrzana https://github.com/bristol-seds/pico-tracker
[rtc] simplify since_aprs
rodzic
f59c70ef4f
commit
35f2ecacfc
|
@ -97,9 +97,6 @@ void rtc_hibernate_time(uint32_t time_s)
|
||||||
{
|
{
|
||||||
/* set hibernate time */
|
/* set hibernate time */
|
||||||
hibernate_time_s = time_s;
|
hibernate_time_s = time_s;
|
||||||
|
|
||||||
/* clear ticks */
|
|
||||||
since_aprs_s += tick;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Interrupt for RTC, called at 1Hz
|
* Interrupt for RTC, called at 1Hz
|
||||||
|
@ -112,7 +109,6 @@ void RTC_Handler(void)
|
||||||
/* Check sleep time */
|
/* Check sleep time */
|
||||||
if (tick >= hibernate_time_s) {
|
if (tick >= hibernate_time_s) {
|
||||||
/* clear ticks */
|
/* clear ticks */
|
||||||
since_aprs_s += tick;
|
|
||||||
tick = 0;
|
tick = 0;
|
||||||
|
|
||||||
/* set hibernate time to max */
|
/* set hibernate time to max */
|
||||||
|
@ -124,6 +120,7 @@ void RTC_Handler(void)
|
||||||
} else {
|
} else {
|
||||||
/* Increment tick */
|
/* Increment tick */
|
||||||
tick++;
|
tick++;
|
||||||
|
since_aprs_s++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue