Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r9cf99616cedc2bdf73b1af4dbbb43ee1cf3ef06b -rd5f2ac4d84453feb1b782f35f9d69432977a95f6 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 9cf99616cedc2bdf73b1af4dbbb43ee1cf3ef06b) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision d5f2ac4d84453feb1b782f35f9d69432977a95f6) @@ -7,8 +7,8 @@ * * @file OperationModes.c * -* @author (last) Dara Navaei -* @date (last) 25-Apr-2022 +* @author (last) Michael Garthwaite +* @date (last) 08-Aug-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -154,10 +154,6 @@ lastMode = currentMode; transitionToNewOperationMode( newMode ); currentMode = newMode; - - // Mode is changing, write the RO generated volume to the RTC RAM and set the service flag to FALSE - // since this is not a from a service change - setROWaterGeneratedL( getROGeneratedVolumeL(), FALSE ); } // mode specific processing to be done continuously @@ -420,6 +416,34 @@ /*********************************************************************//** * @brief + * The testSetOperationMode function will transition to a given operation + * mode if the transition is legal. + * @details Inputs: none + * @details Outputs: modeRequest[] + * @param newMode ID of requested mode to transition to + * @return TRUE if request successful, FALSE if not + *************************************************************************/ +BOOL testSetOperationMode( DG_OP_MODE_T newMode ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + DG_OP_MODE_T check = MODE_TRANSITION_TABLE[ currentMode ][ newMode ]; + + // Is mode transition legal? + if ( check == newMode ) + { + requestNewOperationMode( newMode ); + result = TRUE; + } + } + + return result; +} + +/*********************************************************************//** + * @brief * The testSetDGOpModePublishIntervalOverride function overrides the * DG operation mode publish interval. * @details Inputs: none