int main( void ) { fbw_init(); #ifndef NO_MAINLOOP while( 1 ) { #endif fbw_schedule(); if(timer_periodic()) { _1Hz++; _20Hz++; if (_1Hz >= 60) { _1Hz = 0; } if (_20Hz >= 3) { _20Hz = 0; } } #ifndef NO_MAINLOOP } #endif return 0; }
int main( void ) { uint8_t init_cpt; /* init peripherals */ timer_init(); modem_init(); adc_init(); #ifdef CTL_BRD_V1_1 adc_buf_channel(ADC_CHANNEL_BAT, &buf_bat); #endif spi_init(); link_fbw_init(); gps_init(); nav_init(); ir_init(); estimator_init(); # ifdef PAPABENCH_SINGLE fbw_init(); # endif /* start interrupt task */ //sei(); /*Fadia*/ /* Wait 0.5s (for modem init ?) */ init_cpt = 30; _Pragma("loopbound min 31 max 31") while (init_cpt) { if (timer_periodic()) init_cpt--; } /* enter mainloop */ #ifndef NO_MAINLOOP while( 1 ) { #endif if(timer_periodic()) { periodic_task(); # if PAPABENCH_SINGLE fbw_schedule(); # endif } if (gps_msg_received) { /*receive_gps_data_task()*/ parse_gps_msg(); send_gps_pos(); send_radIR(); send_takeOff(); } if (link_fbw_receive_complete) { link_fbw_receive_complete = FALSE; radio_control_task(); } #ifndef NO_MAINLOOP } #endif return 0; }
void vPapabenchInit() { mode = MODE_AUTO; pprz_mode = PPRZ_MODE_HOME; timer_init(); modem_init(); adc_init(); #ifdef CTL_BRD_V1_1 adc_buf_channel(uint8_t adc_channel, struct adc_buf *s); #endif spi_init(); link_fbw_init(); gps_init(); nav_init(); ir_init(); estimator_init(); #ifdef PAPABENCH_SINGLE fbw_init(); #endif }
int main( void ) { fbw_init(); while( ! term ) { fbw_schedule(); if(timer_periodic()) { _1Hz++; _20Hz++; if (_1Hz >= 60) { _1Hz = 0; } if (_20Hz >= 3) { _20Hz = 0; } } } return 0; }