Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -rbb63d313f1edeb2fa72f992cedab03b13cdf644a -raf2cd84d3319b1e298057fe2d329aa7824306507 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision bb63d313f1edeb2fa72f992cedab03b13cdf644a) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision af2cd84d3319b1e298057fe2d329aa7824306507) @@ -114,7 +114,7 @@ /// Conversion from PWM duty cycle % to commanded pump motor speed. #define BP_PWM_TO_MOTOR_SPEED_RPM(pwm) ( ((pwm) - BP_PWM_ZERO_OFFSET) * 4000.0F ) /// Conversion macro from mL/min to estimated PWM duty cycle %. -#define BP_ML_PER_MIN_FROM_PWM(pwm) ( ( pwm / ( BP_ML_PER_MIN_TO_PUMP_RPM_FACTOR * BP_GEAR_RATIO * BP_MOTOR_RPM_TO_PWM_DC_FACTOR) ) - BP_PWM_ZERO_OFFSET ) +#define BP_ML_PER_MIN_FROM_PWM(pwm) ( ( ( pwm - BP_PWM_ZERO_OFFSET ) / ( BP_ML_PER_MIN_TO_PUMP_RPM_FACTOR * BP_GEAR_RATIO * BP_MOTOR_RPM_TO_PWM_DC_FACTOR ) ) ) /// Measured blood flow is filtered w/ moving average. #define SIZE_OF_ROLLING_AVG ( ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) * 1 ) @@ -1610,23 +1610,23 @@ return result; } + /*********************************************************************//** * @brief - * The testResetBloodPumpRotorCountOverride function resets the override - * of the blood pump rotor counter. + * The testSetDialInPumpTargetDutyCycle function resets the override of the + * measured dialIn pump motor current. * @details Inputs: none - * @details Outputs: bloodPumpRotorCounter + * @details Outputs: adcDialInPumpMCCurrentmA * @return TRUE if reset successful, FALSE if not *************************************************************************/ -BOOL testResetBloodPumpRotorCountOverride( void ) +BOOL testSetBloodPumpTargetDutyCycle( F32 value ) { BOOL result = FALSE; if ( TRUE == isTestingActivated() ) { + targetDialInFlowRate = (S32) BP_ML_PER_MIN_FROM_PWM( value ); result = TRUE; - bloodPumpRotorCounter.override = OVERRIDE_RESET; - bloodPumpRotorCounter.ovData = bloodPumpRotorCounter.ovInitData; } return result;