Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -rd91a24c730aeb5cd7e3eba9ef4eca78e442911f8 -r0d8381c50f7189c4cfbc2794a4aedf297eea7d15 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision d91a24c730aeb5cd7e3eba9ef4eca78e442911f8) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 0d8381c50f7189c4cfbc2794a4aedf297eea7d15) @@ -43,6 +43,7 @@ // ********** private data ********** static volatile BOOL modeRequest[ NUM_OF_MODES - 1 ]; ///< Pending operation mode change requests. +static HD_OP_MODE_T lastMode = MODE_INIT; ///< Last operation mode prior to current mode. static HD_OP_MODE_T currentMode = MODE_INIT; ///< Current operation mode. static U32 currentSubMode = 0; ///< The currently active state of the active mode. static U32 broadcastModeIntervalCtr = 11; ///< Interval counter used to determine when to broadcast operation mode. Initialize to 11 to stagger broadcast. @@ -126,6 +127,7 @@ if ( currentMode != newMode ) { // handle transition to new mode + lastMode = currentMode; transitionToNewOperationMode( newMode ); currentMode = newMode; } @@ -314,4 +316,26 @@ } } +/*********************************************************************//** + * @brief + * The testRestorePriorModeFromFault function restores the operation mode + * to its prior mode if currently in fault mode. + * This is a test function and requires a tester be logged into the HD. + * @details Inputs: lastMode + * @details Outputs: currentMode. + * @return none + *************************************************************************/ +void testRestorePriorModeFromFault( void ) +{ + // verify tester has logged in with HD + if ( TRUE == isTestingActivated() ) + { + // if in fault mode, go back to prior mode + if ( MODE_FAUL == currentMode ) + { + currentMode = lastMode; + } + } +} + /**@}*/