Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -ra69fcb7945b0300b47ce3287f8cb22c7c26171dc -r8466e63f95f65a3ffb18c3af85ac99328e41167b --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision a69fcb7945b0300b47ce3287f8cb22c7c26171dc) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 8466e63f95f65a3ffb18c3af85ac99328e41167b) @@ -55,10 +55,13 @@ static BOOL flushStartReqReceived = FALSE; ///< Flag indicates user has requested initiation of flush mode. static BOOL heatDisinfectStartReqReceived = FALSE; ///< Flag indicates user has requested initiation of heat disinfect mode. static BOOL chemDisinfectStartReqReceived = FALSE; ///< Flag indicates user has requested initiation of chemical disinfect mode. -static U32 dataPublishCounter = 0; ///< Disinfects data publish counter. static BOOL hasDisinfectCmdBeenSet = FALSE; ///< Flag indicates that a disinfect command has been set. static DG_DISINFECT_STATE_T dgDisinfectState; ///< DG disinfect state to be boadcast to UI. +static U32 dataPublishCounter = 0; ///< Disinfects data publish counter. +/// Interval (in task intervals) at which to publish standby mode data to CAN bus. +static OVERRIDE_U32_T standbyModePublishInterval = { DISINFECTS_DATA_PUB_INTERVAL, DISINFECTS_DATA_PUB_INTERVAL, DISINFECTS_DATA_PUB_INTERVAL, 0 }; + // ********** private function prototypes ********** static HD_STANDBY_STATE_T handleStandbyModeWaitForTreatmentState( void ); @@ -128,11 +131,6 @@ BOOL stop = isStopButtonPressed(); #ifndef RUN_WITHOUT_DG - if ( TRUE == stop ) - { - activateAlarmNoData( ALARM_ID_TREATMENT_STOPPED_BY_USER ); // TODO - remove alarm? Nothing to stop here. - } - // State machine to get DG to prep a reservoir so we can start a treatment switch ( currentStandbyState ) { @@ -670,4 +668,57 @@ } } + +/************************************************************************* + * TEST SUPPORT FUNCTIONS + *************************************************************************/ + + +/*********************************************************************//** + * @brief + * The testSetStandbyModePublishIntervalOverride function sets the override of the + * standby mode data publication interval. + * @details Inputs: none + * @details Outputs: standbyModePublishInterval + * @param ms milliseconds between standby mode broadcasts + * @return TRUE if override set successful, FALSE if not + *************************************************************************/ +BOOL testSetStandbyModePublishIntervalOverride( U32 ms ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + U32 intvl = ms / TASK_GENERAL_INTERVAL; + + result = TRUE; + standbyModePublishInterval.ovData = intvl; + standbyModePublishInterval.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetStandbyModePublishIntervalOverride function resets the override of the + * standby mode data publication interval. + * @details Inputs: none + * @details Outputs: standbyModePublishInterval + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetStandbyModePublishIntervalOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + standbyModePublishInterval.override = OVERRIDE_RESET; + standbyModePublishInterval.ovData = standbyModePublishInterval.ovInitData; + } + + return result; +} + /**@}*/