Index: firmware/App/Modes/FPModes/FPOperationModes.c =================================================================== diff -u -rc554353ba10c84377f0b9f7218f911543a293598 -r5295636b779c5ee16f5e5b999cb2487cb8331cc7 --- firmware/App/Modes/FPModes/FPOperationModes.c (.../FPOperationModes.c) (revision c554353ba10c84377f0b9f7218f911543a293598) +++ firmware/App/Modes/FPModes/FPOperationModes.c (.../FPOperationModes.c) (revision 5295636b779c5ee16f5e5b999cb2487cb8331cc7) @@ -433,21 +433,29 @@ * has a boost pump installed. * @details \b Inputs: none * @details \b Outputs: none - * @return the rejection reason codes for stopping generate permeate. + * @return the rejection reason code for stopping generate permeate. *************************************************************************/ REQUEST_REJECT_REASON_CODE_T signalStopGenPermeate( void ) { REQUEST_REJECT_REASON_CODE_T reason = REQUEST_REJECT_REASON_NONE; + BOOL result = FALSE; + // Stop is agnostic to defeatured/featured. // As long as were not in fault or POST, request to go to standby to stop - if ( currentMode >= FP_MODE_STAN ) + if ( TRUE == isFPDefeatured() ) { - requestNewFPOperationMode( FP_MODE_STAN ); + result = requestPreGenDefStop(); } else { + result = requestPreGenStop(); + } + + if ( FALSE == result ) + { reason = REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE; } + return reason; } @@ -457,20 +465,28 @@ * has a boost pump installed. * @details \b Inputs: none * @details \b Outputs: none - * @return the rejection reason codes for starting generate permeate. + * @return the rejection reason code for starting generate permeate. *************************************************************************/ REQUEST_REJECT_REASON_CODE_T signalStartGenPermeate( void ) { REQUEST_REJECT_REASON_CODE_T reason = REQUEST_REJECT_REASON_NONE; + BOOL result = FALSE; + // TODO - Service and disinfection checks happen here. if ( TRUE == isFPDefeatured() ) { - requestNewFPOperationMode( FP_MODE_DPGP ); + result = requestPreGenDefStart(); } else { - requestNewFPOperationMode( FP_MODE_PGEN ); + result = requestPreGenStart(); } + + if ( FALSE == result ) + { + reason = REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE; + } + return reason; } Index: firmware/App/Modes/FPModes/ModePreGenPermeateDefeatured.c =================================================================== diff -u -rd79faa7118db6d048ce3433224b3e5a478c97a98 -r5295636b779c5ee16f5e5b999cb2487cb8331cc7 --- firmware/App/Modes/FPModes/ModePreGenPermeateDefeatured.c (.../ModePreGenPermeateDefeatured.c) (revision d79faa7118db6d048ce3433224b3e5a478c97a98) +++ firmware/App/Modes/FPModes/ModePreGenPermeateDefeatured.c (.../ModePreGenPermeateDefeatured.c) (revision 5295636b779c5ee16f5e5b999cb2487cb8331cc7) @@ -285,9 +285,12 @@ { BOOL result = FALSE; - result = TRUE; - pendingStartPreGenDefRequest = TRUE; - requestNewFPOperationMode( FP_MODE_DPGP ); + if ( ( FP_MODE_STAN == getCurrentFPOperationMode() ) && ( FP_STANDBY_MODE_STATE_IDLE == getCurrentFPStandbyState() ) ) + { + result = TRUE; + pendingStartPreGenDefRequest = TRUE; + requestNewFPOperationMode( FP_MODE_DPGP ); + } return result; }