Index: firmware/App/Tasks/TaskBG.c =================================================================== diff -u -re5bb82cad756fbb10f04d576dffd499df78f6b35 -r8e7158d8231435496fcf1d5649e51babf859ccc7 --- firmware/App/Tasks/TaskBG.c (.../TaskBG.c) (revision e5bb82cad756fbb10f04d576dffd499df78f6b35) +++ firmware/App/Tasks/TaskBG.c (.../TaskBG.c) (revision 8e7158d8231435496fcf1d5649e51babf859ccc7) @@ -1,18 +1,19 @@ -/************************************************************************** - * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN - * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. - * - * @file TaskTimer.c - * - * @date 20-Sep-2019 - * @author S. Nash - * - * @brief Timer task handler. - * - **************************************************************************/ +/************************************************************************** +* +* Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. +* +* THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN +* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +* +* @file TaskBG.c +* +* @author (last) Sean Nash +* @date (last) 24-Sep-2020 +* +* @author (original) Dara Navaei +* @date (original) 05-Nov-2019 +* +***************************************************************************/ #include #include "NVDataMgmt.h" @@ -22,44 +23,46 @@ #include "WatchdogMgmt.h" #include "TaskTimer.h" +/** + * @addtogroup TaskBackground + * @{ + */ + // ********** private definitions ********** -#define MAX_TIME_FOR_UI_TO_COMMUNICATE_MS 30000 // 30 seconds +#define MAX_TIME_FOR_UI_TO_COMMUNICATE_MS 30000 ///< Maximum time we wait for UI to communicate after power up (30 seconds). // ********** private data ********** -static U32 startUICommTimeout; -static BOOL uiIsCommunicating = FALSE; +static U32 startUICommTimeout; ///< Timer counter for UI to begin communicating. -/************************************************************************* - * @brief taskBackground +// ********** private function prototypes ********** + +/*********************************************************************//** + * @brief * The taskBackground function handles the idle Background Task loop. * Calls the Watchdog Mgmt. and NonVolatile Data services. - * @details - * Inputs : none - * Outputs : Executive for watchdog mgmt. and non-volatile data services called. + * @details Inputs: none + * @details Outputs: Executive for watchdog mgmt. and non-volatile data services called. + * @return none *************************************************************************/ void taskBackground( void ) { - startUICommTimeout = getMSTimerCount(); + 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 ( FALSE == uiCommunicated() ) { - if ( TRUE == uiCommunicated() ) +#ifndef SIMULATE_UI + if ( TRUE == didTimeout( startUICommTimeout, MAX_TIME_FOR_UI_TO_COMMUNICATE_MS ) ) { - uiIsCommunicating = TRUE; + activateAlarmNoData( ALARM_ID_UI_COMM_POST_FAILED ); } - else - { - if ( TRUE == didTimeout( startUICommTimeout, MAX_TIME_FOR_UI_TO_COMMUNICATE_MS ) ) - { - activateAlarmNoData( ALARM_ID_UI_COMM_POST_FAILED ); - } - } +#endif } // manage the watchdog @@ -69,4 +72,5 @@ execNVDataMgmt(); } } - + +/**@}*/