void APP_Tasks ( void ) { /* Check the application's current state. */ switch ( appData.state ) { /* Application's initial state. */ case APP_STATE_INIT: { bool appInitialized = true; if (appInitialized) { // appData.state = APP_STATE_SERVICE_TASKS; /* Enable ADC */ DRV_ADC_Open(); appData.state = APP_STATE_IDLE; } break; } // case APP_STATE_SERVICE_TASKS: // { // // break; // } /* TODO: implement your application state machine.*/ case APP_STATE_IDLE: { if (true == appData.dataReady) { appData.state = APP_STATE_DISPLAY_ADC_AVERAGE; } } case APP_STATE_DISPLAY_ADC_AVERAGE: { if(true == appData.dataReady) { APP_ADC_AverageOnLEDs(); } appData.dataReady = false; appData.state = APP_STATE_IDLE; } break; /* The default state should never be executed. */ default: { /* TODO: Handle error in application's state machine. */ break; } } }