Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -rd66ded5492dd8a760b235b12cb6767f0427ba573 -r1d22a723272b4225b10b296c25339bdc90b4236d --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision d66ded5492dd8a760b235b12cb6767f0427ba573) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 1d22a723272b4225b10b296c25339bdc90b4236d) @@ -41,7 +41,7 @@ #define CONCENTRATE_PUMP_CLEANING_SPD_OUT_OF_RANGE_TOL_PCT 0.05F ///< Concentrate pump cleaning mode speed out of range tolerance when on in percentage. #define CONCENTRATE_PUMP_SPD_OUT_OF_RANGE_TOL_WHEN_SLOW_MLPM 1.0F ///< Concentrate pump speed out of range tolerance when slow in mL/min. #define CONCENTRATE_PUMP_LOW_SPEED_THRESHOLD_MLPM 10.0F ///< Concentrate pump low speed threshold in mL/min. -#define CONCENTRATE_PUMP_ZERO_FLOW_RATE 0xFFFF ///< Pulse width value when zero flow rate or pump is off. +#define CONCENTRATE_PUMP_ZERO_FLOW_RATE 0xFFFFFFFF ///< Pulse width value when zero flow rate or pump is off. #define CONCENTRATE_PUMP_VOLUME_PER_REV_DIENER 0.4F ///< Volume output every revolution (mL). #define CONCENTRATE_PUMP_VOLUME_PER_REV 0.1F ///< Volume output every revolution (mL). @@ -107,7 +107,7 @@ CONCENTRATE_PUMP_STATE_T execState; ///< Concentrate pump execute current state. BOOL hasTurnOnPumpsBeenRequested; ///< Flag indicates a request to turn concentrate pumps on. F32 currentPumpSpeed; ///< Current controlled concentrate pumps' speed (mL/min). - U16 togglePeriodCount; ///< Converted pump speed (mL/min) to toggle period counts (0.5 uS increment counts per step). + U32 togglePeriodCount; ///< Converted pump speed (mL/min) to toggle period counts (0.5 uS increment counts per step). U08 direction; ///< Concentrate pump motor direction. U08 controlSet; ///< Concentrate pump control set. (Used in DVT) F32 pulseWidthUS; ///< Concentrate pump pulse width in microseconds. @@ -1057,7 +1057,7 @@ timePerStep = CONCENTRATE_PUMP_VOLUME_PER_REV_DIENER / ( concentratePumps[ pumpId ].currentPumpSpeed * CONCENTRATE_PUMP_STEP_PER_REV ); stepPeriodCounts = timePerStep / ( CONCENTRATE_PUMP_STEP_PERIOD_RESOLUTION * CONCENTRATE_PUMP_MICRO_STEPS_PER_STEP ); - concentratePumps[ pumpId ].togglePeriodCount = (U16)( stepPeriodCounts + FLOAT_TO_INT_ROUNDUP_OFFSET ); + concentratePumps[ pumpId ].togglePeriodCount = (U32)( stepPeriodCounts + FLOAT_TO_INT_ROUNDUP_OFFSET ); } else { @@ -1097,7 +1097,7 @@ static void calcMeasuredPumpsSpeed( void ) { CONCENTRATE_PUMPS_T pumpId; - U16 pulseWidthCount = 0; + U32 pulseWidthCount = 0; F32 pulseWidthInMicroSeconds = 0.0F; BOOL isPulseWidthOut = FALSE; CONCENTRATE_PUMPS_T pumpInAlarm = CONCENTRATEPUMPS_FIRST;