diff --git a/firmware/main.c b/firmware/main.c index e25f14b..8c94a35 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -83,6 +83,7 @@ void lcd_title(const char *msg1, const char *msg2) int main() { char *post_msg; + uint8_t sched = 0; MCUSR &= ~(1 << WDRF); WDTCSR = (1 << WDCE); @@ -108,8 +109,20 @@ int main() while (1) { if (!spi_proc()) { - timer_proc(); - input_proc(); + switch (sched) { + case 0: + timer_proc(); + break; + case 1: + input_proc(); + break; + } + } + sched = sched + 1; + if (sched == 4) { + sched = 0; + if (batmon_proc()) + reset(); } } return 0;