int main(void) { sched_init(); /* initialize the scheduler */ led_init(); /* initialize led */ button_init(); /* initialize button */ adc_init(); /* initialize ADC (battery voltage measurement) */ serial_init(); /* initialize serial communication */ wheel_init(); /* initialize encoders, PWM output, PID etc. */ pid_interval = 50; /* default PID update interval 50ms */ pid_rate = 1000/pid_interval; /* [Hz] always remember after setting pid_interval */ pfbst_interval = 20; /* send $PFBST at 20 ms interval */ nmea_wd_timeout = 1; /* set PFBCT watchdog timeout to 100ms */ nmea_wd = NMEA_WD_TOUT+1; /* make sure we begin in watchdog timeout state */ voltage_min = VOLTAGE_MIN_DEFAULT; battery_low_warning = false; state_update(); sei(); /* enable interrupts */ nmea_init(); /* initialize nmea protocol handler */ for (;;) /* go into an endless loop */ { /* motor_update(); */ if (t1ms != 0) /* if the interrupt has timed out after 10ms */ { t1ms --; sched_update(); /* run the scheduler */ } else { nmea_rx_update(); } } return 0; /* just for the principle as we never get here */ }
void filesystem_update() { sched_update(); int i; int j; i = 20; j = 30; printf("%s %d: %s()\n", __FILE__, __LINE__, __FUNCTION__); }
void network_update() { sched_update(); int i; int j; i = 20; j = 30; printf("%s %d: %s()\n", __FILE__, __LINE__, __FUNCTION__); }
static int timer_intr_handler (void) { intr_eoi (); sched_update(); return 0; }