Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -r8afac005a36a62d8d36e58a4c46d0225b3367204 -r89ffa1705cdf4e2d0a7be8f6cfd340f1f590e243 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 8afac005a36a62d8d36e58a4c46d0225b3367204) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 89ffa1705cdf4e2d0a7be8f6cfd340f1f590e243) @@ -8,7 +8,7 @@ * @file BloodFlow.c * * @author (last) Sean Nash -* @date (last) 18-Jan-2023 +* @date (last) 08-Mar-2023 * * @author (original) Sean Nash * @date (original) 07-Nov-2019 @@ -90,7 +90,7 @@ #define BP_MAX_CURR_WHEN_STOPPED_MA 150.0F ///< Motor controller current should not exceed this when pump should be stopped. #define BP_MAX_CURR_WHEN_RUNNING_MA 2000.0F ///< Motor controller current should not exceed this when pump should be running. -#define BP_MAX_CURR_ERROR_DURATION_MS 2000 ///< Motor controller current errors persisting beyond this duration will trigger an alarm. +#define BP_MAX_CURR_ERROR_DURATION_MS 5000 ///< Motor controller current errors persisting beyond this duration will trigger an alarm. #define BLOODPUMP_ADC_FULL_SCALE_V 3.0F ///< BP analog signals are 0-3V (while int. ADC ref may be different). #define BLOODPUMP_ADC_ZERO 1998 ///< Blood pump ADC channel zero offset. @@ -964,6 +964,7 @@ if ( ++bloodFlowDataPublicationTimerCounter >= getU32OverrideValue( &bloodFlowDataPublishInterval ) ) { BLOOD_PUMP_STATUS_PAYLOAD_T payload; + HD_OP_MODE_T opMode = getCurrentOperationMode(); payload.setPoint = targetBloodFlowRate; payload.measFlow = getMeasuredBloodFlowRate(); @@ -973,6 +974,14 @@ payload.measMCCurr = getMeasuredBloodPumpMCCurrent(); payload.pwmDC = bloodPumpPWMDutyCyclePctSet * FRACTION_TO_PERCENT_FACTOR; payload.rotorCount = getBloodPumpRotorCount(); + if ( ( MODE_PRET == opMode ) || ( MODE_TREA == opMode ) || ( MODE_POST == opMode ) ) + { // prescribed flow only available in treatment modes + payload.presFlow = getTreatmentParameterU32( TREATMENT_PARAM_BLOOD_FLOW ); + } + else + { + payload.presFlow = 0; + } broadcastData( MSG_ID_BLOOD_FLOW_DATA, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&payload, sizeof( BLOOD_PUMP_STATUS_PAYLOAD_T ) ); bloodFlowDataPublicationTimerCounter = 0; }