Index: firmware/App/Modes/BloodPrime.c =================================================================== diff -u -ra2a882ee989ef142887cd54a0f8311addaca812d -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Modes/BloodPrime.c (.../BloodPrime.c) (revision a2a882ee989ef142887cd54a0f8311addaca812d) +++ firmware/App/Modes/BloodPrime.c (.../BloodPrime.c) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -51,7 +51,7 @@ static const U32 BLOOD_PRIME_RAMPING_INTERVAL = ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); /// Interval at which blood prime progress is to be published to UI. -static const U32 BLOOD_PRIME_DATA_PUBLISH_INTERVAL = ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); +#define BLOOD_PRIME_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) /// Multiplier to convert flow (mL/min) into volume (mL) for period of general task interval. static const F32 BLOOD_PRIME_FLOW_INTEGRATOR = 1.0 / (F32)( SEC_PER_MIN * ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); @@ -65,6 +65,8 @@ static U32 bloodPrimeRampControlTimerCtr; ///< Timer counter for determining interval for controlling BP ramp. static U32 bloodPrimePublishTimerCtr; ///< Timer counter for determining interval for blood prime status to be published. +/// Interval (in task intervals) at which to publish blood prime data to CAN bus. +static OVERRIDE_U32_T bloodPrimePublishInterval = { BLOOD_PRIME_DATA_PUBLISH_INTERVAL, BLOOD_PRIME_DATA_PUBLISH_INTERVAL, BLOOD_PRIME_DATA_PUBLISH_INTERVAL, 0 }; static OVERRIDE_F32_T cumulativeBloodPrimeVolume_mL = { 0.0, 0.0, 0.0, 0 }; ///< Total cumulative blood prime volume (in mL). static OVERRIDE_F32_T bloodPrimeVolumeDelivered_Safety = { 0.0, 0.0, 0.0, 0 }; ///< The cumulative independent blood prime volume (in mL) calculated so far. @@ -318,7 +320,7 @@ *************************************************************************/ static void publishBloodPrimeData( void ) { - if ( ++bloodPrimePublishTimerCtr >= BLOOD_PRIME_DATA_PUBLISH_INTERVAL ) + if ( ++bloodPrimePublishTimerCtr >= getU32OverrideValue( &bloodPrimePublishInterval ) ) { BLOOD_PRIME_DATA_PAYLOAD_T data; @@ -426,4 +428,51 @@ return result; } +/*********************************************************************//** + * @brief + * The testSetBloodPrimePublishIntervalOverride function sets the override of the + * blood prime data publication interval. + * @details Inputs: none + * @details Outputs: bloodPrimePublishInterval + * @param ms milliseconds between blood prime broadcasts + * @return TRUE if override set successful, FALSE if not + *************************************************************************/ +BOOL testSetBloodPrimePublishIntervalOverride( U32 ms ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + U32 intvl = ms / TASK_GENERAL_INTERVAL; + + result = TRUE; + bloodPrimePublishInterval.ovData = intvl; + bloodPrimePublishInterval.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetBloodPrimePublishIntervalOverride function resets the override of the + * blood prime data publication interval. + * @details Inputs: none + * @details Outputs: bloodPrimePublishInterval + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetBloodPrimePublishIntervalOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + bloodPrimePublishInterval.override = OVERRIDE_RESET; + bloodPrimePublishInterval.ovData = bloodPrimePublishInterval.ovInitData; + } + + return result; +} + /**@}*/ Index: firmware/App/Modes/BloodPrime.h =================================================================== diff -u -rfc12876da6930c955864352182aee2076513a1cc -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Modes/BloodPrime.h (.../BloodPrime.h) (revision fc12876da6930c955864352182aee2076513a1cc) +++ firmware/App/Modes/BloodPrime.h (.../BloodPrime.h) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -56,6 +56,8 @@ BOOL testResetBloodPrimeVolumeOverride( void ); BOOL testSetBloodPrimeSafetyVolumeOverride( F32 vol ); BOOL testResetBloodPrimeSafetyVolumeOverride( void ); +BOOL testSetBloodPrimePublishIntervalOverride( U32 ms ); +BOOL testResetBloodPrimePublishIntervalOverride( void ); /**@}*/ Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -rd27dcf1fbbc9651636f211028917a1c0702bb56a -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision d27dcf1fbbc9651636f211028917a1c0702bb56a) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -55,11 +55,11 @@ #define PREVENT_UF_VOL_CHANGE_IF_NEARLY_DONE_SEC ( 10 * SEC_PER_MIN ) ///< Prevent UF volume change if treatment within this much time from end of treatment (in seconds). /// Interval (ms/task time) at which the treatment time data is published on the CAN bus. -static const U32 TREATMENT_TIME_DATA_PUB_INTERVAL = ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); +#define TREATMENT_TIME_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) /// Interval (ms/task time) at which the treatment state data is published on the CAN bus. -static const U32 TREATMENT_STATE_DATA_PUB_INTERVAL = ( 250 / TASK_GENERAL_INTERVAL ); +#define TREATMENT_STATE_DATA_PUB_INTERVAL ( 250 / TASK_GENERAL_INTERVAL ) /// Interval (ms/task time) at which updated, valid treatment setting ranges are published on the CAN bus. -static const U32 TREATMENT_SETTINGS_RANGES_PUB_INTERVAL = ( ( 60 * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ); +#define TREATMENT_SETTINGS_RANGES_PUB_INTERVAL ( ( 60 * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ) #define CALC_ELAPSED_TREAT_TIME_IN_SECS() ( treatmentTimeMS / MS_PER_SECOND ) ///< Macro to calculate the elapsed treatment time in seconds. /// Macro to calculate the elapsed treatment time in minutes. @@ -86,6 +86,12 @@ static U32 treatmentTimeBroadcastTimerCtr; ///< Treatment time data broadcast timer counter used to schedule when to transmit data. static U32 treatmentStateBroadcastTimerCtr; ///< Treatment state data broadcast timer counter used to schedule when to transmit data. static U32 treatmentParamsRangesBroadcastTimerCtr; ///< Treatment parameter ranges broadcast timer counter used to schedule when to transmit updated ranges. +/// Interval (in task intervals) at which to publish alarm status to CAN bus. +static OVERRIDE_U32_T treatmentTimePublishInterval = { TREATMENT_TIME_DATA_PUB_INTERVAL, TREATMENT_TIME_DATA_PUB_INTERVAL, TREATMENT_TIME_DATA_PUB_INTERVAL, 0 }; +/// Interval (in task intervals) at which to publish alarm status to CAN bus. +static OVERRIDE_U32_T treatmentStatePublishInterval = { TREATMENT_STATE_DATA_PUB_INTERVAL, TREATMENT_STATE_DATA_PUB_INTERVAL, TREATMENT_STATE_DATA_PUB_INTERVAL, 0 }; +/// Interval (in task intervals) at which to publish alarm status to CAN bus. +static OVERRIDE_U32_T treatmentParamRangesPublishInterval = { TREATMENT_SETTINGS_RANGES_PUB_INTERVAL, TREATMENT_SETTINGS_RANGES_PUB_INTERVAL, TREATMENT_SETTINGS_RANGES_PUB_INTERVAL, 0 }; static BOOL resumeTreatmentAlarmResponseRequest; ///< Flag indicates user has requested treatment resume. static BOOL initiateRinsebackAlarmResponseRequest; ///< Flag indicates user has requested rinseback. @@ -113,6 +119,9 @@ static TREATMENT_STATE_T handleTreatmentRinsebackState( void ); static TREATMENT_STATE_T handleTreatmentRecircState( void ); static TREATMENT_STATE_T handleTreatmentEndState( void ); +static U32 getPublishTreatmentTimeInterval( void ); +static U32 getPublishTreatmentStateInterval( void ); +static U32 getPublishTreatmentParamRangesInterval( void ); /*********************************************************************//** * @brief @@ -1146,7 +1155,7 @@ // Update treatment time stats and broadcast - end treatment if time elapsedTreatmentTimeInSecs = CALC_ELAPSED_TREAT_TIME_IN_SECS(); // Broadcast treatment time data at interval - if ( ++treatmentTimeBroadcastTimerCtr >= TREATMENT_TIME_DATA_PUB_INTERVAL ) + if ( ++treatmentTimeBroadcastTimerCtr >= getPublishTreatmentTimeInterval() ) { if ( isTreatmentCompleted() != TRUE ) { @@ -1161,7 +1170,7 @@ treatmentTimeBroadcastTimerCtr = 0; } // Broadcast treatment state data at interval - if ( ++treatmentStateBroadcastTimerCtr >= TREATMENT_STATE_DATA_PUB_INTERVAL ) + if ( ++treatmentStateBroadcastTimerCtr >= getPublishTreatmentStateInterval() ) { TREATMENT_STATE_DATA_T payload; @@ -1183,6 +1192,66 @@ /*********************************************************************//** * @brief + * The getPublishTreatmentTimeInterval function gets the treatment time data + * publication interval. + * @details Inputs: treatmentTimePublishInterval + * @details Outputs: none + * @return the current treatment time data publication interval (in task intervals). + *************************************************************************/ +static U32 getPublishTreatmentTimeInterval( void ) +{ + U32 result = treatmentTimePublishInterval.data; + + if ( OVERRIDE_KEY == treatmentTimePublishInterval.override ) + { + result = treatmentTimePublishInterval.ovData; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getPublishTreatmentStateInterval function gets the treatment state data + * publication interval. + * @details Inputs: treatmentStatePublishInterval + * @details Outputs: none + * @return the current treatment state data publication interval (in task intervals). + *************************************************************************/ +static U32 getPublishTreatmentStateInterval( void ) +{ + U32 result = treatmentStatePublishInterval.data; + + if ( OVERRIDE_KEY == treatmentStatePublishInterval.override ) + { + result = treatmentStatePublishInterval.ovData; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getPublishTreatmentParamRangesInterval function gets the treatment param + * range data publication interval. + * @details Inputs: treatmentParamRangesPublishInterval + * @details Outputs: none + * @return the current treatment param range data publication interval (in task intervals). + *************************************************************************/ +static U32 getPublishTreatmentParamRangesInterval( void ) +{ + U32 result = treatmentParamRangesPublishInterval.data; + + if ( OVERRIDE_KEY == treatmentParamRangesPublishInterval.override ) + { + result = treatmentParamRangesPublishInterval.ovData; + } + + return result; +} + +/*********************************************************************//** + * @brief * The broadcastTreatmentSettingsRanges function computes and broadcasts * updated treatment parameter ranges that the user may change during treatment. * It is assumed that prescription settings have already been set prior to calling @@ -1193,7 +1262,7 @@ *************************************************************************/ static void broadcastTreatmentSettingsRanges( void ) { - if ( ++treatmentParamsRangesBroadcastTimerCtr >= TREATMENT_SETTINGS_RANGES_PUB_INTERVAL ) + if ( ++treatmentParamsRangesBroadcastTimerCtr >= getPublishTreatmentParamRangesInterval() ) { // Compute minimum treatment duration U32 presTime = ( presTreatmentTimeSecs / SEC_PER_MIN ); @@ -1256,4 +1325,145 @@ return result; } +/*********************************************************************//** + * @brief + * The testSetTreatmentTimePublishIntervalOverride function sets the override of the + * treatment time data publication interval. + * @details Inputs: none + * @details Outputs: treatmentTimePublishInterval + * @param ms milliseconds between treatment time broadcasts + * @return TRUE if override set successful, FALSE if not + *************************************************************************/ +BOOL testSetTreatmentTimePublishIntervalOverride( U32 ms ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + U32 intvl = ms / TASK_GENERAL_INTERVAL; + + result = TRUE; + treatmentTimePublishInterval.ovData = intvl; + treatmentTimePublishInterval.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetTreatmentTimePublishIntervalOverride function resets the override of the + * treatment time data publication interval. + * @details Inputs: none + * @details Outputs: treatmentTimePublishInterval + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetTreatmentTimePublishIntervalOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + treatmentTimePublishInterval.override = OVERRIDE_RESET; + treatmentTimePublishInterval.ovData = treatmentTimePublishInterval.ovInitData; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testSetTreatmentStatePublishIntervalOverride function sets the override of the + * treatment state data publication interval. + * @details Inputs: none + * @details Outputs: treatmentStatePublishInterval + * @param ms milliseconds between treatment state broadcasts + * @return TRUE if override set successful, FALSE if not + *************************************************************************/ +BOOL testSetTreatmentStatePublishIntervalOverride( U32 ms ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + U32 intvl = ms / TASK_GENERAL_INTERVAL; + + result = TRUE; + treatmentStatePublishInterval.ovData = intvl; + treatmentStatePublishInterval.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetTreatmentStatePublishIntervalOverride function resets the override of the + * treatment state data publication interval. + * @details Inputs: none + * @details Outputs: treatmentStatePublishInterval + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetTreatmentStatePublishIntervalOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + treatmentStatePublishInterval.override = OVERRIDE_RESET; + treatmentStatePublishInterval.ovData = treatmentStatePublishInterval.ovInitData; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testSetTreatmentParamRangesPublishIntervalOverride function sets the override of the + * treatment param ranges data publication interval. + * @details Inputs: none + * @details Outputs: treatmentParamRangesPublishInterval + * @param ms milliseconds between treatment param range broadcasts + * @return TRUE if override set successful, FALSE if not + *************************************************************************/ +BOOL testSetTreatmentParamRangesPublishIntervalOverride( U32 ms ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + U32 intvl = ms / TASK_GENERAL_INTERVAL; + + result = TRUE; + treatmentParamRangesPublishInterval.ovData = intvl; + treatmentParamRangesPublishInterval.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetTreatmentParamRangesPublishIntervalOverride function resets the override of the + * treatment param ranges data publication interval. + * @details Inputs: none + * @details Outputs: treatmentParamRangesPublishInterval + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetTreatmentParamRangesPublishIntervalOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + treatmentParamRangesPublishInterval.override = OVERRIDE_RESET; + treatmentParamRangesPublishInterval.ovData = treatmentParamRangesPublishInterval.ovInitData; + } + + return result; +} + /**@}*/ Index: firmware/App/Modes/ModeTreatment.h =================================================================== diff -u -rea91805fa5ea8b23cfcaa0ee2493339e57fe7fc7 -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision ea91805fa5ea8b23cfcaa0ee2493339e57fe7fc7) +++ firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -111,6 +111,12 @@ BOOL verifyPressureLimitsChange( PRESSURE_LIMIT_CHANGE_REQUEST_T *data ); BOOL testSetTreatmentTimeRemainingOverride( U32 value ); +BOOL testSetTreatmentTimePublishIntervalOverride( U32 ms ); +BOOL testResetTreatmentTimePublishIntervalOverride( void ); +BOOL testSetTreatmentStatePublishIntervalOverride( U32 ms ); +BOOL testResetTreatmentStatePublishIntervalOverride( void ); +BOOL testSetTreatmentParamRangesPublishIntervalOverride( U32 ms ); +BOOL testResetTreatmentParamRangesPublishIntervalOverride( void ); /**@}*/ Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -ra2a882ee989ef142887cd54a0f8311addaca812d -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision a2a882ee989ef142887cd54a0f8311addaca812d) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -49,7 +49,7 @@ static const F32 MIN_RINSEBACK_SAFETY_VOLUME_ML = ( TARGET_RINSEBACK_VOLUME_ML * 0.8 ); /// Interval at which rinseback progress is to be published to UI. -static const U32 RINSEBACK_DATA_PUBLISH_INTERVAL = ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); +#define RINSEBACK_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) /// Maximum time allowed for rinseback operation until full volume is delivered. Timer is reset whenever BP is running. static const U32 MAX_RINSEBACK_TIME = ( 5 * SEC_PER_MIN * ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); /// Maximum time allowed for each additional rinseback volume delivery. @@ -71,6 +71,8 @@ static U32 rinsebackLastMotorCount; ///< The last BP motor encoder count read for independent rinseback volume check. static U32 rinsebackAdditionalTimerCtr; ///< Timer counter for duration of an additional rinseback delivery. static U32 rinsebackPublishTimerCtr; ///< Timer counter for determining interval for rinseback status to be published. +/// Interval (in task intervals) at which to publish rinseback data to CAN bus. +static OVERRIDE_U32_T rinsebackPublishInterval = { RINSEBACK_DATA_PUBLISH_INTERVAL, RINSEBACK_DATA_PUBLISH_INTERVAL, RINSEBACK_DATA_PUBLISH_INTERVAL, 0 }; static BOOL startRinsebackRequested; ///< Flag indicates user requesting rinseback start (confirming saline bag move to arterial line end). static BOOL incrRinsebackFlowRateRequested; ///< Flag indicates user requesting rinseback flow rate be increased. @@ -111,6 +113,7 @@ static BOOL handleEndTreatmentUserAction( REQUEST_REJECT_REASON_CODE_T *rejReason ); static void publishRinsebackData( void ); +static U32 getPublishRinsebackInterval( void ); /*********************************************************************//** * @brief @@ -972,7 +975,7 @@ *************************************************************************/ static void publishRinsebackData( void ) { - if ( ++rinsebackPublishTimerCtr >= RINSEBACK_DATA_PUBLISH_INTERVAL ) + if ( ++rinsebackPublishTimerCtr >= getPublishRinsebackInterval() ) { RINSEBACK_DATA_PAYLOAD_T data; U32 timeout = MAX_RINSEBACK_TIME / ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); @@ -1002,7 +1005,27 @@ } } +/*********************************************************************//** + * @brief + * The getPublishRinsebackInterval function gets the rinseback data + * publication interval. + * @details Inputs: rinsebackPublishInterval + * @details Outputs: none + * @return the current rinseback publication interval (in task intervals). + *************************************************************************/ +static U32 getPublishRinsebackInterval( void ) +{ + U32 result = rinsebackPublishInterval.data; + if ( OVERRIDE_KEY == rinsebackPublishInterval.override ) + { + result = rinsebackPublishInterval.ovData; + } + + return result; +} + + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ @@ -1098,4 +1121,51 @@ return result; } +/*********************************************************************//** + * @brief + * The testSetRinsebackPublishIntervalOverride function sets the override of the + * rinseback data publication interval. + * @details Inputs: none + * @details Outputs: rinsebackPublishInterval + * @param ms milliseconds between rinseback broadcasts + * @return TRUE if override set successful, FALSE if not + *************************************************************************/ +BOOL testSetRinsebackPublishIntervalOverride( U32 ms ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + U32 intvl = ms / TASK_GENERAL_INTERVAL; + + result = TRUE; + rinsebackPublishInterval.ovData = intvl; + rinsebackPublishInterval.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetRinsebackPublishIntervalOverride function resets the override of the + * rinseback data publication interval. + * @details Inputs: none + * @details Outputs: rinsebackPublishInterval + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetRinsebackPublishIntervalOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + rinsebackPublishInterval.override = OVERRIDE_RESET; + rinsebackPublishInterval.ovData = rinsebackPublishInterval.ovInitData; + } + + return result; +} + /**@}*/ Index: firmware/App/Modes/Rinseback.h =================================================================== diff -u -ra2a882ee989ef142887cd54a0f8311addaca812d -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Modes/Rinseback.h (.../Rinseback.h) (revision a2a882ee989ef142887cd54a0f8311addaca812d) +++ firmware/App/Modes/Rinseback.h (.../Rinseback.h) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -62,6 +62,8 @@ BOOL testResetRinsebackVolumeOverride( void ); BOOL testSetRinsebackSafetyVolumeOverride( F32 vol ); BOOL testResetRinsebackSafetyVolumeOverride( void ); +BOOL testSetRinsebackPublishIntervalOverride( U32 ms ); +BOOL testResetRinsebackPublishIntervalOverride( void ); /**@}*/ Index: firmware/App/Modes/TreatmentStop.c =================================================================== diff -u -r85a18ee758116bb8e19b80b18f166a691a464bb7 -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision 85a18ee758116bb8e19b80b18f166a691a464bb7) +++ firmware/App/Modes/TreatmentStop.c (.../TreatmentStop.c) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -37,20 +37,23 @@ /// Maximum time in this mode before blood sitting warning given (in general task intervals). static const U32 MAX_TIME_BLOOD_SITTING = ( ( 5 * SEC_PER_MIN * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ); /// Treatment stop status broadcast interval. -static const U32 TREATMENT_STOP_DATA_PUBLISH_INTERVAL = ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); +#define TREATMENT_STOP_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) // ********** private data ********** static TREATMENT_STOP_STATE_T currentTxStopState; ///< Current treatment stop state. static U32 bloodSittingTimerCtr; ///< Timer counter tracks time in this mode while blood is sitting. static U32 stopPublishTimerCtr; ///< Timer counter (in GP task intervals) counts time to next status broadcast. +/// Interval (in task intervals) at which to publish treatment stop sub-mode data to CAN bus. +static OVERRIDE_U32_T treatmentStopPublishInterval = { TREATMENT_STOP_DATA_PUBLISH_INTERVAL, TREATMENT_STOP_DATA_PUBLISH_INTERVAL, TREATMENT_STOP_DATA_PUBLISH_INTERVAL, 0 }; // ********** private function prototypes ********** static TREATMENT_STOP_STATE_T handleTreatmentStopRecircState( void ); static TREATMENT_STOP_STATE_T handleTreatmentStopNoRecircState( void ); static void publishTreatmentStopData( void ); +static U32 getPublishTreatmentStopInterval( void ); /*********************************************************************//** * @brief @@ -223,7 +226,7 @@ *************************************************************************/ static void publishTreatmentStopData( void ) { - if ( ++stopPublishTimerCtr >= TREATMENT_STOP_DATA_PUBLISH_INTERVAL ) + if ( ++stopPublishTimerCtr >= getPublishTreatmentStopInterval() ) { U32 timeout = MAX_TIME_BLOOD_SITTING / ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); U32 countdown = ( bloodSittingTimerCtr >= MAX_TIME_BLOOD_SITTING ? 0 : ( MAX_TIME_BLOOD_SITTING - bloodSittingTimerCtr ) / ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); @@ -233,4 +236,77 @@ } } +/*********************************************************************//** + * @brief + * The getPublishTreatmentStopInterval function gets the treatment stop sub-mode data + * publication interval. + * @details Inputs: treatmentStopPublishInterval + * @details Outputs: none + * @return the current treatment stop sub-mode publication interval (in task intervals). + *************************************************************************/ +static U32 getPublishTreatmentStopInterval( void ) +{ + U32 result = treatmentStopPublishInterval.data; + + if ( OVERRIDE_KEY == treatmentStopPublishInterval.override ) + { + result = treatmentStopPublishInterval.ovData; + } + + return result; +} + + +/************************************************************************* + * TEST SUPPORT FUNCTIONS + *************************************************************************/ + + +/*********************************************************************//** + * @brief + * The testSetTreatmentStopPublishIntervalOverride function sets the override of the + * treatment stop sub-mode data publication interval. + * @details Inputs: none + * @details Outputs: treatmentStopPublishInterval + * @param ms milliseconds between treatment stop sub-mode broadcasts + * @return TRUE if override set successful, FALSE if not + *************************************************************************/ +BOOL testSetTreatmentStopPublishIntervalOverride( U32 ms ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + U32 intvl = ms / TASK_GENERAL_INTERVAL; + + result = TRUE; + treatmentStopPublishInterval.ovData = intvl; + treatmentStopPublishInterval.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetTreatmentStopPublishIntervalOverride function resets the override of the + * treatment stop sub-mode data publication interval. + * @details Inputs: none + * @details Outputs: treatmentStopPublishInterval + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetTreatmentStopPublishIntervalOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + treatmentStopPublishInterval.override = OVERRIDE_RESET; + treatmentStopPublishInterval.ovData = treatmentStopPublishInterval.ovInitData; + } + + return result; +} + /**@}*/ Index: firmware/App/Modes/TreatmentStop.h =================================================================== diff -u -r3135defd5053f5724eac7375ffd56ad1d129d5ae -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Modes/TreatmentStop.h (.../TreatmentStop.h) (revision 3135defd5053f5724eac7375ffd56ad1d129d5ae) +++ firmware/App/Modes/TreatmentStop.h (.../TreatmentStop.h) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -42,6 +42,9 @@ TREATMENT_STOP_STATE_T getCurrentTreatmentStopState( void ); +BOOL testSetTreatmentStopPublishIntervalOverride( U32 ms ); +BOOL testResetTreatmentStopPublishIntervalOverride( void ); + /**@}*/ #endif Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -r953879c2319ea70007bfc303422155dd162d87e5 -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 953879c2319ea70007bfc303422155dd162d87e5) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -36,7 +36,7 @@ // ********** private definitions ********** /// Interval to control lamp and audio and to publish alarm status data. -static const U32 ALARM_STATUS_PUBLISH_INTERVAL = ( ALARM_LAMP_AND_AUDIO_CONTROL_INTERVAL_MS / TASK_GENERAL_INTERVAL ); +#define ALARM_STATUS_PUBLISH_INTERVAL ( ALARM_LAMP_AND_AUDIO_CONTROL_INTERVAL_MS / TASK_GENERAL_INTERVAL ) /// Interval (ms/task time) at which the alarm information is published on the CAN bus. #define ALARM_INFO_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) @@ -108,6 +108,8 @@ static BOOL alarmIsDetected[ NUM_OF_ALARM_IDS ]; /// Table - when alarm became active for each alarm (if active) or zero (if inactive) static OVERRIDE_U32_T alarmStartedAt[ NUM_OF_ALARM_IDS ]; +/// Interval (in task intervals) at which to publish alarm status to CAN bus. +static OVERRIDE_U32_T alarmStatusPublishInterval = { ALARM_STATUS_PUBLISH_INTERVAL, ALARM_STATUS_PUBLISH_INTERVAL, ALARM_STATUS_PUBLISH_INTERVAL, 0 }; /// Interval (in task intervals) at which to publish alarm information to CAN bus. static OVERRIDE_U32_T alarmInfoPublishInterval = { ALARM_INFO_PUB_INTERVAL, ALARM_INFO_PUB_INTERVAL, ALARM_INFO_PUB_INTERVAL, 0 }; #ifndef ALARM_VOLUME_DEFAULT_LOW @@ -155,6 +157,7 @@ static U32 getAlarmStartTime( ALARM_ID_T alarmID ); static void publishAlarmInfo( void ); +static U32 getPublishAlarmStatusInterval( void ); static U32 getPublishAlarmInfoInterval( void ); /*********************************************************************//** @@ -229,7 +232,7 @@ updateAlarmsFlags(); updateAlarmsSilenceStatus(); // Publish alarm status at interval - if ( ++alarmStatusPublicationTimerCounter >= ALARM_STATUS_PUBLISH_INTERVAL ) + if ( ++alarmStatusPublicationTimerCounter >= getPublishAlarmStatusInterval() ) { // Lamp and audio timing sync'd with broadcast so UI can stay in sync with lamp rhythm setAlarmLamp(); @@ -1138,8 +1141,28 @@ /*********************************************************************//** * @brief - * The getPublishAlarmInfoInterval function gets the blood flow data + * The getPublishAlarmStatusInterval function gets the alarm status data * publication interval. + * @details Inputs: alarmStatusPublishInterval + * @details Outputs: none + * @return the current alarm status publication interval (in task intervals). + *************************************************************************/ +static U32 getPublishAlarmStatusInterval( void ) +{ + U32 result = alarmStatusPublishInterval.data; + + if ( OVERRIDE_KEY == alarmStatusPublishInterval.override ) + { + result = alarmStatusPublishInterval.ovData; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getPublishAlarmInfoInterval function gets the alarm information + * publication interval. * @details Inputs: alarmInfoPublishInterval * @details Outputs: none * @return the current alarm information publication interval (in task intervals). @@ -1467,6 +1490,53 @@ /*********************************************************************//** * @brief + * The testSetAlarmStatusPublishIntervalOverride function sets the override of the + * alarm status publication interval. + * @details Inputs: none + * @details Outputs: alarmStatusPublishInterval + * @param ms milliseconds between alarm status broadcasts + * @return TRUE if override set successful, FALSE if not + *************************************************************************/ +BOOL testSetAlarmStatusPublishIntervalOverride( U32 ms ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + U32 intvl = ms / TASK_GENERAL_INTERVAL; + + result = TRUE; + alarmStatusPublishInterval.ovData = intvl; + alarmStatusPublishInterval.override = OVERRIDE_KEY; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetAlarmStatusPublishIntervalOverride function resets the override of the + * alarm status publication interval. + * @details Inputs: none + * @details Outputs: alarmStatusPublishInterval + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetAlarmStatusPublishIntervalOverride( void ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + result = TRUE; + alarmStatusPublishInterval.override = OVERRIDE_RESET; + alarmStatusPublishInterval.ovData = alarmStatusPublishInterval.ovInitData; + } + + return result; +} + +/*********************************************************************//** + * @brief * The testSetAlarmInfoPublishIntervalOverride function sets the override of the * alarm information publication interval. * @details Inputs: none Index: firmware/App/Services/AlarmMgmt.h =================================================================== diff -u -r8e50cc04fb92d9b4ee9045e445ca8451abe951ab -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 8e50cc04fb92d9b4ee9045e445ca8451abe951ab) +++ firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -298,6 +298,8 @@ BOOL testSetAlarmStartOverride( U32 alarmID, U32 value ); BOOL testResetAlarmStartOverride( U32 alarmID ); BOOL testClearAllAlarms( U32 key ); +BOOL testSetAlarmStatusPublishIntervalOverride( U32 ms ); +BOOL testResetAlarmStatusPublishIntervalOverride( void ); BOOL testSetAlarmInfoPublishIntervalOverride( U32 ms ); BOOL testResetAlarmInfoPublishIntervalOverride( void ); BOOL testSetAlarmAudioVolumeLevelOverride( U32 volume ); Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -ra2a882ee989ef142887cd54a0f8311addaca812d -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision a2a882ee989ef142887cd54a0f8311addaca812d) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -1667,6 +1667,50 @@ handleSetHDServiceRecord( message ); break; + case MSG_ID_HD_ALARM_STATUS_PUBLISH_INTERVAL_OVERRIDE: + handleTestAlarmStatusSendIntervalOverrideRequest( message ); + break; + + case MSG_ID_HD_TREATMENT_TIME_DATA_PUBLISH_INTERVAL_OVERRIDE: + handleTestTreatmentTimeDataSendIntervalOverrideRequest( message ); + break; + + case MSG_ID_HD_TREATMENT_RANGES_PUBLISH_INTERVAL_OVERRIDE: + handleTestTreatmentRangesSendIntervalOverrideRequest( message ); + break; + + case MSG_ID_HD_TREATMENT_STOP_DATA_PUBLISH_INTERVAL_OVERRIDE: + handleTestTreatmentStopDataSendIntervalOverrideRequest( message ); + break; + + case MSG_ID_HD_BLOOD_PRIME_DATA_PUBLISH_INTERVAL_OVERRIDE: + handleTestBloodPrimeDataSendIntervalOverrideRequest( message ); + break; + + case MSG_ID_HD_RINSEBACK_DATA_PUBLISH_INTERVAL_OVERRIDE: + handleTestRinsebackDataSendIntervalOverrideRequest( message ); + break; + + case MSG_ID_HD_STANDBY_DATA_PUBLISH_INTERVAL_OVERRIDE: + handleTestStandbyModeDataSendIntervalOverrideRequest( message ); + break; + + case MSG_ID_HD_OP_MODE_DATA_PUBLISH_INTERVAL_OVERRIDE: + handleTestOpModeDataSendIntervalOverrideRequest( message ); + break; + + case MSG_ID_HD_PRE_TREATMENT_DATA_PUBLISH_INTERVAL_OVERRIDE: + handleTestPreTreatmentModeDataSendIntervalOverrideRequest( message ); + break; + + case MSG_ID_HD_TREATMENT_DATA_PUBLISH_INTERVAL_OVERRIDE: + handleTestTreatmentModeSendIntervalOverrideRequest( message ); + break; + + case MSG_ID_HD_POST_TREATMENT_DATA_PUBLISH_INTERVAL_OVERRIDE: + handleTestPostTreatmentModeSendIntervalOverrideRequest( message ); + break; + default: // Unrecognized message ID received - ignore break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -ra2a882ee989ef142887cd54a0f8311addaca812d -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision a2a882ee989ef142887cd54a0f8311addaca812d) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -34,7 +34,8 @@ #include "SystemComm.h" #include "SystemCommMessages.h" #include "TreatmentEnd.h" -#include "TreatmentRecirc.h" +#include "TreatmentRecirc.h" +#include "TreatmentStop.h" #include "Utilities.h" #include "WatchdogMgmt.h" @@ -6344,6 +6345,358 @@ /*********************************************************************//** * @brief + * The handleTestAlarmStatusSendIntervalOverrideRequest function handles a + * request to override the HD alarm status broadcast interval. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestAlarmStatusSendIntervalOverrideRequest( 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 = testSetAlarmStatusPublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetAlarmStatusPublishIntervalOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestTreatmentTimeDataSendIntervalOverrideRequest function handles a + * request to override the HD treatment time data broadcast interval. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestTreatmentTimeDataSendIntervalOverrideRequest( 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 = testSetTreatmentTimePublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetTreatmentTimePublishIntervalOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestTreatmentRangesSendIntervalOverrideRequest function handles a + * request to override the HD treatment param ranges broadcast interval. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestTreatmentRangesSendIntervalOverrideRequest( 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 = testSetTreatmentParamRangesPublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetTreatmentParamRangesPublishIntervalOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestTreatmentStopDataSendIntervalOverrideRequest function handles a + * request to override the HD treatment stop sub-mode data broadcast interval. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestTreatmentStopDataSendIntervalOverrideRequest( 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 = testSetTreatmentStopPublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetTreatmentStopPublishIntervalOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestBloodPrimeDataSendIntervalOverrideRequest function handles a + * request to override the HD blood prime sub-mode data broadcast interval. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestBloodPrimeDataSendIntervalOverrideRequest( 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 = testSetBloodPrimePublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetBloodPrimePublishIntervalOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestRinsebackDataSendIntervalOverrideRequest function handles a + * request to override the HD rinseback sub-mode data broadcast interval. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestRinsebackDataSendIntervalOverrideRequest( 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 = testSetRinsebackPublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetRinsebackPublishIntervalOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestStandbyModeDataSendIntervalOverrideRequest function handles a + * request to override the HD standby mode data broadcast interval. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestStandbyModeDataSendIntervalOverrideRequest( 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 = testSetAlarmInfoPublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetAlarmInfoPublishIntervalOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestOpModeDataSendIntervalOverrideRequest function handles a + * request to override the HD operation mode data broadcast interval. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestOpModeDataSendIntervalOverrideRequest( 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 = testSetAlarmInfoPublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetAlarmInfoPublishIntervalOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestPreTreatmentModeDataSendIntervalOverrideRequest function handles a + * request to override the HD pre-treatment mode data broadcast interval. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestPreTreatmentModeDataSendIntervalOverrideRequest( 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 = testSetAlarmInfoPublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetAlarmInfoPublishIntervalOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestTreatmentModeSendIntervalOverrideRequest function handles a + * request to override the HD treatment mode data broadcast interval. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestTreatmentModeSendIntervalOverrideRequest( 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 = testSetTreatmentStatePublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetTreatmentStatePublishIntervalOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestPostTreatmentModeSendIntervalOverrideRequest function handles a + * request to override the HD post-treatment mode data broadcast interval. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestPostTreatmentModeSendIntervalOverrideRequest( 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 = testSetAlarmInfoPublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetAlarmInfoPublishIntervalOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief * The handleTestAlarmAudioVolumeOverrideRequest function handles a * request to override the alarm audio volume level. * @details Inputs: none Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -ra2a882ee989ef142887cd54a0f8311addaca812d -rc65ad0538ff99c3e13d7d7866ac15e38a1ef6002 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision a2a882ee989ef142887cd54a0f8311addaca812d) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision c65ad0538ff99c3e13d7d7866ac15e38a1ef6002) @@ -729,6 +729,39 @@ // MSG_ID_HD_SYRINGE_PUMP_ADC_READ_COUNTER_OVERRIDE void handleTestSyringePumpADCReadCtrOverrideRequest( MESSAGE_T *message ); +// MSG_ID_HD_ALARM_STATUS_PUBLISH_INTERVAL_OVERRIDE +void handleTestAlarmStatusSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_TREATMENT_TIME_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestTreatmentTimeDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_TREATMENT_RANGES_PUBLISH_INTERVAL_OVERRIDE +void handleTestTreatmentRangesSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_TREATMENT_STOP_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestTreatmentStopDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_BLOOD_PRIME_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestBloodPrimeDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_RINSEBACK_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestRinsebackDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_STANDBY_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestStandbyModeDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_OP_MODE_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestOpModeDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_PRE_TREATMENT_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestPreTreatmentModeDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_TREATMENT_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestTreatmentModeSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_POST_TREATMENT_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestPostTreatmentModeSendIntervalOverrideRequest( MESSAGE_T *message ); + /**@}*/ #endif