Index: firmware/App/Controllers/SubstitutionPump.c =================================================================== diff -u -rb93fd36af5af02e88044107d4331125b11a9bc0e -r09bb4a7c085a868d1eb6d886c94ac6c78e5e92de --- firmware/App/Controllers/SubstitutionPump.c (.../SubstitutionPump.c) (revision b93fd36af5af02e88044107d4331125b11a9bc0e) +++ firmware/App/Controllers/SubstitutionPump.c (.../SubstitutionPump.c) (revision 09bb4a7c085a868d1eb6d886c94ac6c78e5e92de) @@ -110,15 +110,15 @@ static OVERRIDE_U32_T substitutionPumpDataPublishInterval; ///< Substitution pump data publish interval. static SUBSTITUTION_PUMP_T substitutionPumps[ NUM_OF_SUB_PUMPS ]; ///< Array of Substitution pumps' data structure. -static OVERRIDE_F32_T pumpTargetSpeed[ NUM_OF_SUB_PUMPS ]; ///< Target substitution pumps' speed (mL/min). +static OVERRIDE_F32_T pumpTargetRate[ NUM_OF_SUB_PUMPS ]; ///< Target substitution pumps' speed (mL/min). static U32 substitutionPumpPublishTimerCounter; ///< Substitution pump data publication counter. // ********** private function prototypes ********** static void stopSubstitutionPump( SUBSTITUTION_PUMPS_T pumpId ); static SUBSTITUTION_PUMP_STATE_T handleSubstitutionPumpOffState( SUBSTITUTION_PUMPS_T pumpId ); static SUBSTITUTION_PUMP_STATE_T handleSubstitutionPumpControlTargetSpeedState( SUBSTITUTION_PUMPS_T pumpId ); -static BOOL stepSubstitutionPumpToTargetSpeed( SUBSTITUTION_PUMPS_T pumpId ); +static BOOL stepSubstitutionPumpToTargetRate( SUBSTITUTION_PUMPS_T pumpId ); static void checkSubstitutionPumpControlSet( SUBSTITUTION_PUMPS_T pumpId ); static void publishSubstitutionPumpData( void ); @@ -257,19 +257,19 @@ static SUBSTITUTION_PUMP_STATE_T handleSubstitutionPumpControlTargetSpeedState( SUBSTITUTION_PUMPS_T pumpId ) { SUBSTITUTION_PUMP_STATE_T state = SUBSTITUTION_PUMP_CONTROL_TARGET_SPEED_STATE; - F32 targetToCurreSpeedDiffMLPM = fabs( getSubstitutionPumpTargetSpeed( pumpId ) - substitutionPumps[ pumpId ].currentPumpSpeed ); + F32 targetToCurreSpeedDiffMLPM = fabs( getSubstitutionPumpTargetRate( pumpId ) - substitutionPumps[ pumpId ].currentPumpSpeed ); if ( ++substitutionPumps[ pumpId ].controlTimerCounter >= SUBSTITUTION_PUMP_CONTROL_INTERVAL ) { substitutionPumps[ pumpId ].controlTimerCounter = 0; - stepSubstitutionPumpToTargetSpeed( pumpId ); + stepSubstitutionPumpToTargetRate( pumpId ); } if ( targetToCurreSpeedDiffMLPM >= SUBSTITUTION_PUMP_TRANS_TO_RAMP_SPEED_THRESHOLD_MLPM ) { // If the requested target speed is greater than the threshold, transition back to ramp state regardless of the status of the // control interval - stepSubstitutionPumpToTargetSpeed( pumpId ); + stepSubstitutionPumpToTargetRate( pumpId ); state = SUBSTITUTION_PUMP_RAMP_TO_TARGET_SPEED_STATE; } @@ -305,18 +305,18 @@ /*********************************************************************//** * @brief - * The stepSubstitutionPumpToTargetSpeed function steps current step speed - * toward target speed for the given substitution pump,with predefined step increase. + * The stepSubstitutionPumpToTargetRate function steps current step speed + * toward target rate for the given substitution pump,with predefined step increase. * @details \b Inputs: none * @details \b Outputs: currentPumpSpeed[] * @param pumpId substitution pump id to increase current step speed * @return TRUE if the pump has reached to target otherwise, FALSE *************************************************************************/ -static BOOL stepSubstitutionPumpToTargetSpeed( SUBSTITUTION_PUMPS_T pumpId ) +static BOOL stepSubstitutionPumpToTargetRate( SUBSTITUTION_PUMPS_T pumpId ) { F32 speedIncrease; BOOL hasTgtBeenReached = FALSE; - F32 currentToTargetDiff = fabs( getSubstitutionPumpTargetSpeed( pumpId ) - substitutionPumps[ pumpId ].currentPumpSpeed ); + F32 currentToTargetDiff = fabs( getSubstitutionPumpTargetRate( pumpId ) - substitutionPumps[ pumpId ].currentPumpSpeed ); if ( currentToTargetDiff > NEARLY_ZERO ) { @@ -331,15 +331,15 @@ } // Subtract current speed when target speed is smaller - if ( getSubstitutionPumpTargetSpeed( pumpId ) < substitutionPumps[ pumpId ].currentPumpSpeed ) + if ( getSubstitutionPumpTargetRate( pumpId ) < substitutionPumps[ pumpId ].currentPumpSpeed ) { speedIncrease *= -1.0F; } substitutionPumps[ pumpId ].currentPumpSpeed += speedIncrease; // If the pump's target speed is set to be 0, do not ramp down set it to zero immediately - if ( getSubstitutionPumpTargetSpeed( pumpId ) < NEARLY_ZERO ) + if ( getSubstitutionPumpTargetRate( pumpId ) < NEARLY_ZERO ) { substitutionPumps[ pumpId ].currentPumpSpeed = 0.0F; } @@ -388,21 +388,21 @@ /*********************************************************************//** * @brief - * The getSubstitutionPumpTargetSpeed function gets the current target speed for the given + * The getSubstitutionPumpTargetRate function gets the current target speed for the given * substituion pump. - * @details \b Inputs: pumpTargetSpeed + * @details \b Inputs: pumpTargetRate * @details \b Outputs: none * @details \b Alarms: ALARM_ID_DD_SOFTWARE_FAULT when invalid pump ID is seen. - * @param pumpId substitution pump id to get the current target speed - * @return the current target speed for the given concentrate pump. + * @param pumpId substitution pump id to get the current target rate + * @return the current target rate for the given concentrate pump. *************************************************************************/ -F32 getSubstitutionPumpTargetSpeed( SUBSTITUTION_PUMPS_T pumpId ) +F32 getSubstitutionPumpTargetRate( SUBSTITUTION_PUMPS_T pumpId ) { F32 speed = 0.0F; if ( pumpId < NUM_OF_SUB_PUMPS ) { - speed = getF32OverrideValue( &pumpTargetSpeed[ pumpId ] ); + speed = getF32OverrideValue( &pumpTargetRate[ pumpId ] ); } else { @@ -465,14 +465,14 @@ * @details \b Outputs: substitutionPumps[] * @details \b Alarms: ALARM_ID_DD_SOFTWARE_FAULT when invalid pump ID is seen. * @param pumpId pump id to set step speed - * @param targetSpeed_ml_min target speed in mL/min + * @param targetRate_ml_min target speed in mL/min * @return none *************************************************************************/ -void setSubstitutionPumpTargetSpeed( SUBSTITUTION_PUMPS_T pumpId, F32 targetSpeed_ml_min ) +void setSubstitutionPumpTargetSpeed( SUBSTITUTION_PUMPS_T pumpId, F32 targetRate_ml_min ) { if ( pumpId < NUM_OF_SUB_PUMPS ) { - if ( targetSpeed_ml_min >= 0.0 ) + if ( targetRate_ml_min >= 0.0 ) { substitutionPumps[ pumpId ].direction = SUBSTITUTION_PUMP_FORWARD_DIR; substitutionPumps[ pumpId ].controlSet = SUBSTITUTION_PUMP_CONTROL_FORWARD; @@ -481,10 +481,10 @@ { substitutionPumps[ pumpId ].direction = SUBSTITUTION_PUMP_REVERSE_DIR; substitutionPumps[ pumpId ].controlSet = SUBSTITUTION_PUMP_CONTROL_FORWARD; - targetSpeed_ml_min *= -1.0; + targetRate_ml_min *= -1.0; } - pumpTargetSpeed[ pumpId ].data = targetSpeed_ml_min; + pumpTargetRate[ pumpId ].data = targetRate_ml_min; } else { @@ -507,7 +507,7 @@ { SUBSTITUTION_PUMP_DATA_T pumpData; - pumpData.d92_PumpTargetSpeed = pumpTargetSpeed[ D92_PUMP ].data; + pumpData.d92_PumpTargetRate = pumpTargetRate[ D92_PUMP ].data; pumpData.d92_PumpCurrentSetSpeed = substitutionPumps[ D92_PUMP ].currentPumpSpeed; pumpData.d92_PumpState = (U32)substitutionPumps[ D92_PUMP ].execState; pumpData.d92_PumpMeasuredSpeed = substitutionPumps[ D92_PUMP ].measuredPumpSpeed; @@ -553,7 +553,7 @@ *************************************************************************/ BOOL testSubstitutionPumpTargetSpeedOverride( MESSAGE_T *message ) { - BOOL result = f32ArrayOverride( message, &pumpTargetSpeed[ 0 ], NUM_OF_SUB_PUMPS - 1 ); + BOOL result = f32ArrayOverride( message, &pumpTargetRate[ 0 ], NUM_OF_SUB_PUMPS - 1 ); return result; } Index: firmware/App/Controllers/SubstitutionPump.h =================================================================== diff -u -r43c231c0f9a56e2481f94cdbc51f45ef1af23c46 -r09bb4a7c085a868d1eb6d886c94ac6c78e5e92de --- firmware/App/Controllers/SubstitutionPump.h (.../SubstitutionPump.h) (revision 43c231c0f9a56e2481f94cdbc51f45ef1af23c46) +++ firmware/App/Controllers/SubstitutionPump.h (.../SubstitutionPump.h) (revision 09bb4a7c085a868d1eb6d886c94ac6c78e5e92de) @@ -47,7 +47,7 @@ /// Substitution pump data struct. typedef struct { - F32 d92_PumpTargetSpeed; ///< Substitution pump D92_Pump target speed + F32 d92_PumpTargetRate; ///< Substitution pump D92_Pump target speed F32 d92_PumpCurrentSetSpeed; ///< Substitution pump D92_Pump current set speed U32 d92_PumpState; ///< Substitution pump D92_Pump current state F32 d92_PumpMeasuredSpeed; ///< Substitution pump D92_Pump measured speed @@ -61,7 +61,7 @@ void requestSubstitutionPumpOn( SUBSTITUTION_PUMPS_T pumpId ); void requestSubstitutionPumpOff( SUBSTITUTION_PUMPS_T pumpId ); -F32 getSubstitutionPumpTargetSpeed( SUBSTITUTION_PUMPS_T pumpId ); +F32 getSubstitutionPumpTargetRate( SUBSTITUTION_PUMPS_T pumpId ); void setSubstitutionPumpTargetSpeed( SUBSTITUTION_PUMPS_T pumpId, F32 targetSpeed_ml_min ); BOOL testSubstitutionPumpDataPublishIntervalOverride( MESSAGE_T *message );