Index: firmware/App/Services/WatchdogMgmt.c =================================================================== diff -u -rdc0d9b087c609e71cacdb7f0395cccf29d749c00 -r5e0cd9b5be11ff4b2acaadbdcafc4ffe05172aa1 --- firmware/App/Services/WatchdogMgmt.c (.../WatchdogMgmt.c) (revision dc0d9b087c609e71cacdb7f0395cccf29d749c00) +++ firmware/App/Services/WatchdogMgmt.c (.../WatchdogMgmt.c) (revision 5e0cd9b5be11ff4b2acaadbdcafc4ffe05172aa1) @@ -19,45 +19,51 @@ #include "SystemCommMessages.h" #include "Timers.h" #include "WatchdogMgmt.h" + +/** + * @addtogroup WatchdogMgmt + * @{ + */ // ********** private definitions ********** -#define MIN_WATCHDOG_PET_INTERVAL_MS 45 -#define WATCHDOG_POST_TIMEOUT_MS 100 -#define WATCHDOG_RECOVERY_TIME_MS 250 - +#define MIN_WATCHDOG_PET_INTERVAL_MS 45 ///< Minimum watchdog pet interval. +#define WATCHDOG_POST_TIMEOUT_MS 100 ///< Watchdog POST timeout in ms. +#define WATCHDOG_RECOVERY_TIME_MS 250 ///< Watchdog recovery time in ms. + +/// List of watchdog states. typedef enum Button_Self_Test_States { - WATCHDOG_SELF_TEST_STATE_START = 0, - WATCHDOG_SELF_TEST_STATE_IN_PROGRESS, - WATCHDOG_SELF_TEST_STATE_RECOVER, - WATCHDOG_SELF_TEST_STATE_COMPLETE, - NUM_OF_WATCHDOG_SELF_TEST_STATES + WATCHDOG_SELF_TEST_STATE_START = 0, ///< Watchdog self test state start + WATCHDOG_SELF_TEST_STATE_IN_PROGRESS, ///< watchdog self test state in progress + WATCHDOG_SELF_TEST_STATE_RECOVER, ///< Watchdog self test state recover + WATCHDOG_SELF_TEST_STATE_COMPLETE, ///< Watchdog self test state complete + NUM_OF_WATCHDOG_SELF_TEST_STATES ///< Number of watchdog self test states } WATCHDOG_SELF_TEST_STATE_T; // ********** private data ********** -static U32 lastWatchdogPetTime = 0; +static U32 lastWatchdogPetTime = 0; ///< Previous watchdog pet time. -DATA_ARRAY_DECL( BOOL, TaskCheckIns, NUM_OF_TASKS, watchdogTaskCheckedIn ); +DATA_ARRAY_DECL( BOOL, TaskCheckIns, NUM_OF_TASKS, watchdogTaskCheckedIn ); ///< Watchdog task check-in array. -static WATCHDOG_SELF_TEST_STATE_T watchdogSelfTestState = WATCHDOG_SELF_TEST_STATE_START; -static SELF_TEST_STATUS_T watchdogSelfTestStatus; -static U32 watchdogSelfTestTimerCount = 0; +static WATCHDOG_SELF_TEST_STATE_T watchdogSelfTestState; ///< Watchdog self test current state. +static SELF_TEST_STATUS_T watchdogSelfTestStatus; ///< Watchdog self test status. +static U32 watchdogSelfTestTimerCount = 0; ///< Watchdog self test timer count. // ********** private function prototypes ********** static void resetWDTaskCheckIns( void ); static BOOL haveAllTasksCheckedIn( void ); static void petWatchdog( void ); static DATA_ARRAY_GET_PROTOTYPE( BOOL, hasTaskGeneralCheckedIn, task ); - -/************************************************************************* + +/*********************************************************************//** * @brief initWatchdogMgmt - * The initWatchdogMgmt function initializes the watchdog mgmt. module. + * The initWatchdogMgmt function initializes the WatchdogMgmt module. * @details * Inputs : none - * Outputs : Watchdog mgmt. module initialized. + * Outputs : WatchdogMgmt module initialized. * @return none *************************************************************************/ void initWatchdogMgmt( void ) @@ -77,13 +83,13 @@ watchdogTaskCheckedIn[ i ].override = OVERRIDE_RESET; } } - -/************************************************************************* + +/*********************************************************************//** * @brief execWatchdogMgmt - * The execWatchdogMgmt function executes thewatchdog mgmt. service. + * The execWatchdogMgmt function executes the watchdog management service. * @details * Inputs : none - * Outputs : + * Outputs : Pets watchdog when all tasks checked in * @return none *************************************************************************/ void execWatchdogMgmt( void ) @@ -115,15 +121,15 @@ } } } - -/************************************************************************* + +/*********************************************************************//** * @brief checkInWithWatchdogMgmt - * The checkInWithWatchdogMgmt function checks a given task in with the \n - * watchdog mgmt. service. + * The checkInWithWatchdogMgmt function checks a given task in with the + * watchdog management service. * @details * Inputs : none - * Outputs : task is checked in with the watchdog mgmt.. - * @param task the task that is checking in with the watchdog mgmt + * Outputs : task is checked in with the watchdog management + * @param task the task that is checking in with the watchdog management * @return none *************************************************************************/ void checkInWithWatchdogMgmt( TASK_T task ) @@ -133,15 +139,14 @@ watchdogTaskCheckedIn[ task ].data = TRUE; } } - -/************************************************************************* + +/*********************************************************************//** * @brief execWatchdogTest - * The execWatchdogTest function executes the watchdog test. \n - * This function should be called periodically until a pass or fail \n - * result is returned. + * The execWatchdogTest function executes the watchdog test. This function + * should be called periodically until a pass or fail result is returned. * @details - * Inputs : - * Outputs : + * Inputs : watchdogSelfTestState + * Outputs : Executed watchdog self test * @return in progress, passed, or failed *************************************************************************/ SELF_TEST_STATUS_T execWatchdogTest( void ) @@ -195,8 +200,8 @@ return result; } - -/************************************************************************* + +/*********************************************************************//** * @brief resetWDTaskCheckIns * The resetWDTaskCheckIns function resets the task check-ins with the watchdog. * @details @@ -214,10 +219,10 @@ watchdogTaskCheckedIn[ i ].data = FALSE; } } - -/************************************************************************* + +/*********************************************************************//** * @brief haveAllTasksCheckedIn - * The haveAllTasksCheckedIn function determines whether all tasks have /n + * The haveAllTasksCheckedIn function determines whether all tasks have * checked in with watchdog mgmt. * @details * Inputs : watchdogTaskCheckedIn[] @@ -241,23 +246,21 @@ return result; } - -/************************************************************************* + +/*********************************************************************//** * @brief hasTaskGeneralCheckedIn - * The hasTaskGeneralCheckedIn function gets the check-in state of a given /n - * task. + * The hasTaskGeneralCheckedIn function gets the check-in state of a given task. * @details * Inputs : watchdogTaskCheckedIn[] * Outputs : none * @param task ID of task to check * @return TRUE if given task has checked in, FALSE if not *************************************************************************/ static DATA_ARRAY_GET( BOOL, hasTaskGeneralCheckedIn, task, NUM_OF_TASKS-1, watchdogTaskCheckedIn, FALSE ) - -/************************************************************************* + +/*********************************************************************//** * @brief petWatchdog - * The petWatchdog function pets the watchdog by pulsing the CPLD WD pet /n - * signal. + * The petWatchdog function pets the watchdog by pulsing the CPLD WD pet signal. * @details * Inputs : none * Outputs : CPLD WD pet signal is pulsed @@ -277,12 +280,11 @@ * TEST SUPPORT FUNCTIONS *************************************************************************/ - -/************************************************************************* +/*********************************************************************//** * @brief testSetWatchdogTaskCheckInOverride and testResetWatchdogTaskCheckInOverride - * The testSetWatchdogTaskCheckInOverride function overrides the state of the \n - * task check-in with the watchdog management with a given check-in state. \n - * The testResetWatchdogTaskCheckInOverride function resets the override of the \n + * The testSetWatchdogTaskCheckInOverride function overrides the state of the + * task check-in with the watchdog management with a given check-in state. + * The testResetWatchdogTaskCheckInOverride function resets the override of the * state of the check-in with the watchdog management. * @details * Inputs : none @@ -292,3 +294,5 @@ * @return TRUE if override successful, FALSE if not *************************************************************************/ DATA_ARRAY_OVERRIDE_FUNC( BOOL, testSetWatchdogTaskCheckInOverride, testResetWatchdogTaskCheckInOverride, watchdogTaskCheckedIn, task, NUM_OF_TASKS-1 ) + +/**@}*/