Index: firmware/App/Modes/BloodPrime.c =================================================================== diff -u -rcc4f8440e8ad7fa8f2ced2467d922be7422c344c -rfe44ecec55830a90280aec6796974e273982047a --- firmware/App/Modes/BloodPrime.c (.../BloodPrime.c) (revision cc4f8440e8ad7fa8f2ced2467d922be7422c344c) +++ firmware/App/Modes/BloodPrime.c (.../BloodPrime.c) (revision fe44ecec55830a90280aec6796974e273982047a) @@ -7,8 +7,8 @@ * * @file BloodPrime.c * -* @author (last) Dara Navaei -* @date (last) 03-Mar-2022 +* @author (last) Darren Cox +* @date (last) 10-Mar-2022 * * @author (original) Sean Nash * @date (original) 06-Feb-2021 @@ -36,8 +36,9 @@ // ********** private definitiions *********** -#define TUBING_BLOOD_PRIME_VOLUME_ML 80.0 ///< Target blood prime volume to prime the blood side circuit (in mL). -#define MAX_BLOOD_PRIME_VOLUME_ERROR_ML 60.0 ///< Maximum error in total additional blood prime volume (20% of total). +#define TUBING_BLOOD_PRIME_VOLUME_ML 80.0F ///< Target blood prime volume to prime the blood side circuit (in mL). +#define DEFAULT_BLOOD_PRIME_VOLUME_ML 300.0F ///< Default blood prime volume (in mL). +#define MAX_BLOOD_PRIME_VOLUME_ERROR_ML 60.0F ///< Maximum error in total additional blood prime volume (20% of total). #define MIN_RAMP_TIME_SEC 60 ///< Minimum ramp time for blood prime (in seconds). /// Initial flow rate for blood pump when starting blood prime operation. @@ -50,7 +51,7 @@ #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 ) ); +static const F32 BLOOD_PRIME_FLOW_INTEGRATOR = 1.0F / (F32)( SEC_PER_MIN * ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); // ********** private data ********** @@ -93,7 +94,7 @@ bloodPrimePublishTimerCtr = BLOOD_PRIME_DATA_PUBLISH_INTERVAL; cumulativeBloodPrimeVolume_mL.data = 0.0; expectedBloodPrimeVolume_mL = 0.0; - bloodPrimeTargetVolume_mL = 300.0; + bloodPrimeTargetVolume_mL = DEFAULT_BLOOD_PRIME_VOLUME_ML; resetBloodPrimeFlags(); bloodPrimeTargetVolume_mL = (F32)TUBING_BLOOD_PRIME_VOLUME_ML + (F32)getDialyzerBloodVolume(); @@ -237,10 +238,14 @@ cmdStopDGTrimmerHeater(); // Stop trimmer heater - dialysis sub-mode will restart as appropriate } // Is blood prime taking too long based on set BP rate? - else if ( ( fabs( expectedBloodPrimeVolume_mL - getBloodPrimeVolume() ) > MAX_BLOOD_PRIME_VOLUME_ERROR_ML ) && - ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_PUMP_FLOW_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) ) + else if ( fabs( expectedBloodPrimeVolume_mL - getBloodPrimeVolume() ) > MAX_BLOOD_PRIME_VOLUME_ERROR_ML ) { - activateAlarmNoData( ALARM_ID_BLOOD_PRIME_VOLUME_CHECK_FAILURE ); +#ifndef _RELEASE_ + if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_PUMP_FLOW_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) +#endif + { + activateAlarmNoData( ALARM_ID_BLOOD_PRIME_VOLUME_CHECK_FAILURE ); + } } else { @@ -291,7 +296,6 @@ bloodPrimePublishTimerCtr = 0; data.targetBloodPrimeVolumeMl = bloodPrimeTargetVolume_mL; data.deliveredBloodPrimeVolumeMl = getBloodPrimeVolume(); - data.unused = 0.0; // TODO - remove later when UI no longer looking for this field. broadcastData( MSG_ID_HD_BLOOD_PRIME_PROGRESS, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&data, sizeof( BLOOD_PRIME_DATA_PAYLOAD_T ) ); } }