Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -rbd241ef5231a9869adaf7bb5ed166135beb2c0fb -re710c031a8032d03e8926b71f1f7b999fb58211f --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision bd241ef5231a9869adaf7bb5ed166135beb2c0fb) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision e710c031a8032d03e8926b71f1f7b999fb58211f) @@ -7,7 +7,7 @@ * * @file BloodFlow.c * -* @author (last) Dara Navaei +* @author (last) Hung Nguyen * @date (last) 04-Jan-2022 * * @author (original) Sean Nash @@ -87,7 +87,7 @@ /// Persist time period blood pump rotor speed too fast error condition. static const U32 BP_MAX_ROTOR_SPEED_ERROR_PERSIST = ( 1 * MS_PER_SECOND ); /// Persist time (task intervals) blood flow rate out of range error condition. -static const U32 BP_MAX_FLOW_RATE_OUT_OF_RANGE_PERSIST = ((1 * MS_PER_SECOND) / TASK_PRIORITY_INTERVAL); +static const U32 BP_MAX_FLOW_RATE_OUT_OF_RANGE_PERSIST = (1 * MS_PER_SECOND); #define BP_MAX_CURR_WHEN_STOPPED_MA 150.0 ///< Motor controller current should not exceed this when pump should be stopped. #define BP_MAX_CURR_WHEN_RUNNING_MA 2000.0 ///< Motor controller current should not exceed this when pump should be running. @@ -375,7 +375,7 @@ targetBloodFlowRate = 0; stopBloodPump(); bloodPumpState = BLOOD_PUMP_OFF_STATE; - bloodPumpPWMDutyCyclePct = 0.0; + bloodPumpPWMDutyCyclePct = BP_PWM_ZERO_OFFSET; bpControlTimerCounter = 0; resetPIController( PI_CONTROLLER_ID_BLOOD_FLOW, MIN_BLOOD_PUMP_PWM_DUTY_CYCLE ); } @@ -1288,7 +1288,6 @@ } if ( ctrlMode < NUM_OF_PUMP_CONTROL_MODES ) { - targetBloodFlowRate = value; result = setBloodPumpTargetFlowRate( abs(value), dir, (PUMP_CONTROL_MODE_T)ctrlMode ); } }