Index: firmware/App/Modes/ModePostTreat.c =================================================================== diff -u -r30a8d95285f2bd81238ff5536ebe4d53feb51f00 -r8466e63f95f65a3ffb18c3af85ac99328e41167b --- firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision 30a8d95285f2bd81238ff5536ebe4d53feb51f00) +++ firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision 8466e63f95f65a3ffb18c3af85ac99328e41167b) @@ -68,6 +68,8 @@ static HD_POST_TREATMENT_STATE_T currentPostTreatmentState; ///< Current state of post-treatment mode state machine. static DRAIN_STATE_T currentDrainReservoirState; ///< Current drain reservoir state. static U32 postTreatmentPublishTimerCounter; ///< Timer counter used to schedule post-treatment data broadcast. +/// Interval (in task intervals) at which to publish post-treatment mode data to CAN bus. +static OVERRIDE_U32_T postTreatmentModePublishInterval = { POST_TREATMENT_DATA_PUB_INTERVAL, POST_TREATMENT_DATA_PUB_INTERVAL, POST_TREATMENT_DATA_PUB_INTERVAL, 0 }; static TREATMENT_LOG_DATA_PAYLOAD_T treatmentLogData; ///< Treatment parameters record for logging. @@ -171,7 +173,7 @@ break; } - if ( ++postTreatmentPublishTimerCounter >= POST_TREATMENT_DATA_PUB_INTERVAL ) + if ( ++postTreatmentPublishTimerCounter >= getU32OverrideValue( &postTreatmentModePublishInterval ) ) { broadcastPostTreatmentState( currentPostTreatmentState ); postTreatmentPublishTimerCounter = 0; @@ -606,4 +608,57 @@ return state; } + +/************************************************************************* + * TEST SUPPORT FUNCTIONS + *************************************************************************/ + + +/*********************************************************************//** + * @brief + * The testSetPostTreatmentModePublishIntervalOverride function sets the override of the + * post-treatment mode data publication interval. + * @details Inputs: none + * @details Outputs: postTreatmentModePublishInterval + * @param ms milliseconds between post-treatment mode broadcasts + * @return TRUE if override set successful, FALSE if not + *************************************************************************/ +BOOL testSetPostTreatmentModePublishIntervalOverride( U32 ms ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + U32 intvl = ms / TASK_GENERAL_INTERVAL; + + result = TRUE; + postTreatmentModePublishInterval.ovData = intvl; + postTreatmentModePublishInterval.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetPostTreatmentModePublishIntervalOverride function resets the override of the + * post-treatment mode data publication interval. + * @details Inputs: none + * @details Outputs: postTreatmentModePublishInterval + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetPostTreatmentModePublishIntervalOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + postTreatmentModePublishInterval.override = OVERRIDE_RESET; + postTreatmentModePublishInterval.ovData = postTreatmentModePublishInterval.ovInitData; + } + + return result; +} + /**@}*/