Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -r98d8996eaace58d6d75b5884d6e8c0d3c2df3b17 -rda838b2d59d8b12a239cd31f8b68b2b1bf78e4ae --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 98d8996eaace58d6d75b5884d6e8c0d3c2df3b17) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision da838b2d59d8b12a239cd31f8b68b2b1bf78e4ae) @@ -7,8 +7,8 @@ * * @file BloodFlow.c * -* @author (last) Sean Nash -* @date (last) 04-Jan-2022 +* @author (last) Michael Garthwaite +* @date (last) 08-Feb-2022 * * @author (original) Sean Nash * @date (original) 07-Nov-2019 @@ -240,7 +240,7 @@ bpMotorSpeedCalcIdx = 0; for ( i = 0; i < BP_SPEED_CALC_BUFFER_LEN; i++ ) { - bpLastMotorHallSensorCounts[ i ] = 0; + bpLastMotorHallSensorCounts[ i ] = getFPGABloodPumpHallSensorCount(); } resetBloodPumpRotorCount(); @@ -281,11 +281,17 @@ // Don't interrupt pump control unless rate or mode is changing if ( ( dirFlowRate != targetBloodFlowRate ) || ( mode != bloodPumpControlMode ) ) - { -#ifndef NO_PUMP_FLOW_LIMITS - // Verify flow rate - if ( flowRate <= MAX_SET_BLOOD_FLOW_RATE ) + { + BOOL byPassFlowLimit = FALSE; + +#ifndef _RELEASE_ + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_PUMPS_FLOW_LIMITS ) ) + { + byPassFlowLimit = TRUE; + } #endif + // Verify flow rate of if the bypass flow limit has been enabled + if ( ( flowRate <= MAX_SET_BLOOD_FLOW_RATE ) || ( TRUE == byPassFlowLimit ) ) { resetBloodPumpRPMMovingAverage(); targetBloodFlowRate = dirFlowRate; @@ -327,12 +333,16 @@ } result = TRUE; } -#ifndef NO_PUMP_FLOW_LIMITS + else // Requested flow rate too high - { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_BLOOD_FLOW_SET_TOO_HIGH, flowRate ) - } + { +#ifndef _RELEASE_ + if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_PUMPS_FLOW_LIMITS ) != SW_CONFIG_ENABLE_VALUE ) #endif + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_BLOOD_FLOW_SET_TOO_HIGH, flowRate ) + } + } } }