Index: firmware/App/Modes/StateTxBloodPrime.c =================================================================== diff -u -rd0afb42f8728fd5ee05c90ec0e57e1f4eec4067b -r4a61cc40ef8abb068a7ea5bdb67c32e4c9c6d7af --- firmware/App/Modes/StateTxBloodPrime.c (.../StateTxBloodPrime.c) (revision d0afb42f8728fd5ee05c90ec0e57e1f4eec4067b) +++ firmware/App/Modes/StateTxBloodPrime.c (.../StateTxBloodPrime.c) (revision 4a61cc40ef8abb068a7ea5bdb67c32e4c9c6d7af) @@ -59,6 +59,9 @@ /// Timeout duration for Blood Prime pause state. #define BLOOD_PRIME_PAUSE_TIMEOUT_SEC ( 5 * SEC_PER_MIN ) +// Warning threshold before timeout (1 minute remaining) +#define BLOOD_PRIME_WARNING_SEC ( 1 * SEC_PER_MIN ) + // ********** private data ********** static BLOOD_PRIME_STATE_T bloodPrimeState; ///< Current state of the blood prime sub-mode. @@ -494,10 +497,12 @@ /*********************************************************************//** * @brief -* The handleTreatmentPausedBloodSittingTimer function handles the pause -* timeout and trigger warning/alarm. +* The handleBloodPrimePauseTimer function monitors the Blood Prime +* pause timer. * @details Inputs: bloodPrimeStartMS * @details Outputs: bloodPrimeTimeoutSec, bloodPrimeCountdownSec +* @details Alarms: ALARM_ID_TD_BLOOD_PRIME_PAUSE_WARNING +* ALARM_ID_TD_BLOOD_PRIME_PAUSE_TIMEOUT * @return none *************************************************************************/ static void handleBloodPrimePauseTimer( void ) @@ -519,11 +524,11 @@ bloodPrimeCountdownSec = 0; } // Warning when 1 minute is remaining - if ( bloodPrimeCountdownSec <= SEC_PER_MIN ) + if ( bloodPrimeCountdownSec == BLOOD_PRIME_WARNING_SEC ) { activateAlarmNoData( ALARM_ID_TD_BLOOD_PRIME_PAUSE_WARNING ); } - // Alarm when timeout reached + // Alarm when reached to timeout if ( bloodPrimeCountdownSec == 0 ) { activateAlarmNoData( ALARM_ID_TD_BLOOD_PRIME_PAUSE_TIMEOUT ); @@ -552,6 +557,7 @@ { BLOOD_PRIME_DATA_PAYLOAD_T data; bloodPrimePublishTimerCtr = 0; + data.targetBloodPrimeVolumeMl = bloodPrimeTargetVolume_mL; data.deliveredBloodPrimeVolumeMl = MAX( 0.0, getBloodPrimeVolume() ); data.bloodPrimeTimeoutSec = bloodPrimeTimeoutSec;