Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rbd8fa3f754c8a8fd797d1828c416f73680924b64 -r64f7d82ff6637d6fb179d31b0c1481d68ed99143 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision bd8fa3f754c8a8fd797d1828c416f73680924b64) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 64f7d82ff6637d6fb179d31b0c1481d68ed99143) @@ -21,6 +21,7 @@ #include "Heaters.h" #include "ModeStandby.h" #include "OperationModes.h" +#include "Pressures.h" #include "Reservoirs.h" #include "ROPump.h" #include "SystemComm.h" @@ -53,13 +54,16 @@ static U32 waterSampleStartTime = 0; ///< Time stamp for start of water sample state. static U32 filterFlushStartTime = 0; ///< Time stamp for start of filter flush state. static U32 filterFlushPublishTimerCounter = 0; ///< Filter flush data publish timer counter. +/// Filter flush time period in ms. +static OVERRIDE_U32_T filterFlushTimePeriod = { FILTER_FLUSH_TIME_MS, FILTER_FLUSH_TIME_MS, 0, 0 }; // ********** private function prototypes ********** static DG_STANDBY_MODE_STATE_T handleStandbyIdleState( void ); static DG_STANDBY_MODE_STATE_T handleStandbyFlushFilterState( void ); static DG_STANDBY_MODE_STATE_T handleStandbyFlushFilterIdleState( void ); static DG_STANDBY_MODE_STATE_T handleStandbySampleWaterState( void ); +static U32 getFilterFlushTimePeriod( void ); /*********************************************************************//** * @brief @@ -204,17 +208,18 @@ static DG_STANDBY_MODE_STATE_T handleStandbyFlushFilterState( void ) { DG_STANDBY_MODE_STATE_T state = DG_STANDBY_MODE_STATE_FLUSH_FILTER; + U32 const filterFlushTimePeriod_ms = getFilterFlushTimePeriod(); checkInletPressure(); - if ( TRUE == didTimeout( filterFlushStartTime, FILTER_FLUSH_TIME_MS ) ) + if ( TRUE == didTimeout( filterFlushStartTime, filterFlushTimePeriod_ms ) ) { state = DG_STANDBY_MODE_STATE_FLUSH_FILTER_IDLE; } if ( FILTER_FLUSH_DATA_PUBLISH_INTERVAL <= filterFlushPublishTimerCounter++ ) { - U32 const timeout = FILTER_FLUSH_TIME_MS / MS_PER_SECOND; + U32 const timeout = filterFlushTimePeriod_ms / MS_PER_SECOND; U32 const countdown = timeout - ( calcTimeSince( filterFlushStartTime ) / MS_PER_SECOND ); filterFlushPublishTimerCounter = 0; @@ -417,4 +422,74 @@ return standbyState; } +/*********************************************************************//** + * @brief + * The getFilterFlushTimePeriod function gets the filter flush time period. + * @details Inputs: filterFlushTimePeriod + * @details Outputs: none + * @return the current filter flush time period (in ms). + *************************************************************************/ +static U32 getFilterFlushTimePeriod( void ) +{ + U32 result = filterFlushTimePeriod.data; + + if ( OVERRIDE_KEY == filterFlushTimePeriod.override ) + { + result = filterFlushTimePeriod.ovData; + } + + return result; +} + + +/************************************************************************* + * TEST SUPPORT FUNCTIONS + *************************************************************************/ + + +/*********************************************************************//** + * @brief + * The testSetFilterFlushTimePeriodOverride function overrides the filter + * flush time period. + * @details Inputs: none + * @details Outputs: filterFlushTimePeriod + * @param value override concentrate pump data publish interval with (in ms) + * @return TRUE if override successful, FALSE if not + *************************************************************************/ +BOOL testSetFilterFlushTimePeriodOverride( U32 value ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + filterFlushTimePeriod.override = OVERRIDE_KEY; + filterFlushTimePeriod.ovData = value; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetFilterFlushTimePeriodOverride function resets the + * override of the filter flush time period. + * @details Inputs: none + * @details Outputs: filterFlushTimePeriod + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetFilterFlushTimePeriodOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + filterFlushTimePeriod.override = OVERRIDE_RESET; + filterFlushTimePeriod.ovData = filterFlushTimePeriod.ovInitData; + } + + return result; +} + /**@}*/ Index: firmware/App/Modes/ModeStandby.h =================================================================== diff -u -r3eb7c2e62c727be195cd937d49957db9d4ba83b4 -r64f7d82ff6637d6fb179d31b0c1481d68ed99143 --- firmware/App/Modes/ModeStandby.h (.../ModeStandby.h) (revision 3eb7c2e62c727be195cd937d49957db9d4ba83b4) +++ firmware/App/Modes/ModeStandby.h (.../ModeStandby.h) (revision 64f7d82ff6637d6fb179d31b0c1481d68ed99143) @@ -37,15 +37,15 @@ void transitionToStandbyMode( void ); // prepares for transition to standby mode U32 execStandbyMode( void ); // execute the standby mode state machine (call from OperationModes) -DG_STANDBY_MODE_STATE_T getCurrentStandbyState( void ); // get the current state of the standby mode. - void waterSampleCommandHandler( SAMPLE_WATER_CMD_T sampleWaterCmd ); BOOL requestDGStart( void ); // HD requests DG start (go to re-circulate mode) - BOOL startDGFlush( void ); - BOOL startDGHeatDisinfect( void ); // HD start heat disinfect mode +DG_STANDBY_MODE_STATE_T getCurrentStandbyState( void ); // get the current state of the standby mode. +BOOL testSetFilterFlushTimePeriodOverride( U32 value ); +BOOL testResetFilterFlushTimePeriodOverride( void ); + /**@}*/ #endif Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r8467f8ff09e382e0991f14d02683080dc811e24e -r64f7d82ff6637d6fb179d31b0c1481d68ed99143 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 8467f8ff09e382e0991f14d02683080dc811e24e) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 64f7d82ff6637d6fb179d31b0c1481d68ed99143) @@ -1254,6 +1254,10 @@ handleSetFluidLeakStateDetectorOverrideRequest( message ); break; + case MSG_ID_FILTER_FLUSH_TIME_PERIOD_OVERRIDE: + handleFilterFlushTimePeriodOverride(message); + break; + default: // TODO - unrecognized message ID received - ignore break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -ra8bb1da29825b5d666333629fda871652d16229a -r64f7d82ff6637d6fb179d31b0c1481d68ed99143 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision a8bb1da29825b5d666333629fda871652d16229a) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 64f7d82ff6637d6fb179d31b0c1481d68ed99143) @@ -3083,4 +3083,36 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, status ); } +/*********************************************************************//** + * @brief + * The handleFilterFlushTimePeriodOverride function handles a request + * to override the filter flush time period value. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleFilterFlushTimePeriodOverride( MESSAGE_T *message ) +{ + TEST_OVERRIDE_PAYLOAD_T payload; + BOOL result = FALSE; + + // verify payload length + if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) + { + memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) + { + result = testSetFilterFlushTimePeriodOverride( payload.state.u32 ); + } + else + { + result = testResetFilterFlushTimePeriodOverride(); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + /**@}*/ Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r3eb7c2e62c727be195cd937d49957db9d4ba83b4 -r64f7d82ff6637d6fb179d31b0c1481d68ed99143 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 3eb7c2e62c727be195cd937d49957db9d4ba83b4) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 64f7d82ff6637d6fb179d31b0c1481d68ed99143) @@ -335,6 +335,9 @@ // MSG_ID_DG_SET_SCHEDULED_RUNS_RECORD void handleSetDGScheduledRunsRecord( MESSAGE_T *message ); +// MSG_ID_FILTER_FLUSH_TIME_PERIOD_OVERRIDE +void handleFilterFlushTimePeriodOverride( MESSAGE_T *message ); + /**@}*/ #endif