fw: Implement main loop scheduler
This commit is contained in:
parent
e4afc61eba
commit
eed5435335
@ -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()) {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user