Index: firmware/App/Tasks/TaskBG.c =================================================================== diff -u -r40bcef6aa65af6c93ce937c6c4aa2de13e8a78d3 -r070554b23739bf16ea2bf9528ebabda1ce0ffeb3 --- firmware/App/Tasks/TaskBG.c (.../TaskBG.c) (revision 40bcef6aa65af6c93ce937c6c4aa2de13e8a78d3) +++ firmware/App/Tasks/TaskBG.c (.../TaskBG.c) (revision 070554b23739bf16ea2bf9528ebabda1ce0ffeb3) @@ -15,9 +15,19 @@ **************************************************************************/ #include "Common.h" +#include "SystemComm.h" #include "WatchdogMgmt.h" #include "TaskTimer.h" +// ********** private definitions ********** + +#define MAX_TIME_FOR_UI_TO_COMMUNICATE_MS 30000 // 30 seconds + +// ********** private data ********** + +static U32 startUICommTimeout; +static BOOL uiIsCommunicating = FALSE; + /************************************************************************* * @brief taskBackground * The taskBackground function handles the idle Background Task loop. @@ -28,10 +38,28 @@ *************************************************************************/ void taskBackground( void ) { + startUICommTimeout = getMSTimerCount(); #ifndef _VECTORCAST_ // can't have infinite loop in unit test tool while ( 1 ) #endif { + // wait for UI to come up after power up + if ( FALSE == uiIsCommunicating ) + { + if ( TRUE == uiCommunicated() ) + { + uiIsCommunicating = TRUE; + } + else + { + if ( TRUE == didTimeout( startUICommTimeout, MAX_TIME_FOR_UI_TO_COMMUNICATE_MS ) ) + { + activateAlarmNoData( ALARM_ID_UI_COMM_POST_FAILED ); + checkInFromUI(); // pretend we got something from UI to unlock task processing of HD + } + } + } + // manage the watchdog execWatchdogMgmt(); }