Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r3a230bfa79e1f80038e8c243499f8ef7ea11ff60 -r0665a32e26dd466378e6ea6fda940353afc691f1 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 3a230bfa79e1f80038e8c243499f8ef7ea11ff60) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 0665a32e26dd466378e6ea6fda940353afc691f1) @@ -8,7 +8,7 @@ * @file DialInFlow.c * * @author (last) Sean Nash -* @date (last) 08-Mar-2023 +* @date (last) 28-Mar-2023 * * @author (original) Sean * @date (original) 16-Dec-2019 @@ -90,7 +90,7 @@ #define DIP_MAX_CURR_WHEN_STOPPED_MA 150.0F ///< Motor controller current should not exceed this when pump should be stopped. #define DIP_MAX_CURR_WHEN_RUNNING_MA 2000.0F ///< Motor controller current should not exceed this when pump should be running. -#define DIP_MAX_CURR_ERROR_DURATION_MS 2000 ///< Motor controller current errors persisting beyond this duration will trigger an alarm. +#define DIP_MAX_CURR_ERROR_DURATION_MS 5000 ///< Motor controller current errors persisting beyond this duration will trigger an alarm. #define DIAL_IN_PUMP_ADC_FULL_SCALE_V 3.0F ///< BP analog signals are 0-3V (while int. ADC ref V may be different). #define DIAL_IN_PUMP_ADC_ZERO 1998 ///< Mid-point (zero) for ADC readings. @@ -1550,15 +1550,10 @@ **************************************************************************/ static BOOL setDialInPumpToFixedPWM( F32 pwm ) { - MOTOR_DIR_T dir = MOTOR_DIR_FORWARD; + MOTOR_DIR_T dir = ( pwm < 0.0F ? MOTOR_DIR_REVERSE : MOTOR_DIR_FORWARD ); BOOL result = FALSE; F32 pwmFabs = fabs(pwm); - if ( pwm < 0 ) - { - dir = MOTOR_DIR_REVERSE; - } - // Direction change while pump is running is not allowed unless we are turning off if ( ( FALSE == isDialInPumpOn ) && ( dir != dialInPumpDirectionSet ) ) { @@ -1942,14 +1937,12 @@ BOOL result = FALSE; F32 absolutePWM = fabs( pwmPct ); - if ( TRUE == isTestingActivated() ) + // check for max of pump pwm for acceptance. *** Function used in dialyzer re-prime, so no Dialin login required *** + if ( absolutePWM < MAX_DIAL_IN_PUMP_PWM_DUTY_CYCLE ) { - // check for max of pump pwm for acceptance. - if ( absolutePWM < MAX_DIAL_IN_PUMP_PWM_DUTY_CYCLE ) - { - result = setDialInPumpToFixedPWM( pwmPct ); - } + result = setDialInPumpToFixedPWM( pwmPct ); } + return result; }