Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -rc67def50892f9a7c2f1f22985b5351465a8f6773 -r933a18d740285e70be9d00696ed0f5a5381bc8e4 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision c67def50892f9a7c2f1f22985b5351465a8f6773) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 933a18d740285e70be9d00696ed0f5a5381bc8e4) @@ -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. @@ -124,6 +125,7 @@ if ( currentMode != newMode ) { // handle transition to new mode + lastMode = currentMode; transitionToNewOperationMode( newMode ); currentMode = newMode; }