Index: firmware/App/Controllers/BoostPump.c =================================================================== diff -u -r410afd26b3ae5e372310c696c82f58c59235e10d -r8d272582cbd2cb5fc0c6af0fead2867ce02658b0 --- firmware/App/Controllers/BoostPump.c (.../BoostPump.c) (revision 410afd26b3ae5e372310c696c82f58c59235e10d) +++ firmware/App/Controllers/BoostPump.c (.../BoostPump.c) (revision 8d272582cbd2cb5fc0c6af0fead2867ce02658b0) @@ -19,6 +19,7 @@ #include "BoostPump.h" #include "Flow.h" +#include "FluidPump.h" //#include "NVDataMgmt.h" #include "Messaging.h" #include "MessageSupport.h" @@ -55,9 +56,6 @@ #define DATA_PUBLISH_COUNTER_START_COUNT 10 ///< Data publish counter start count. -#define BOOST_FLOW_TO_PWM(flow) ( BOOST_FLOW_TO_PWM_SLOPE * flow + BOOST_FLOW_TO_PWM_INTERCEPT ) ///< PWM line equation for flow. -#define BOOST_PRESSURE_TO_PWM(pres) ( BOOST_PRESSURE_TO_PWM_SLOPE * pres + BOOST_PRESSURE_TO_PWM_INTERCEPT ) ///< PWM line equation for pressure. - /// Enumeration of Boost pump states. typedef enum BoostPump_States { @@ -194,7 +192,7 @@ isBoostPumpOn = FALSE; // Do not control unless boost is installed - if ( TRUE == isBoostPumpInstalled ) + if ( TRUE == isBoostPumpInstalled() ) { // If there is a target pressure set, transition to the PI controller and control to pressure. if ( ( getTargetBoostPumpPressure() > 0.0F ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) @@ -464,8 +462,37 @@ return status; } + /*********************************************************************//** * @brief + * The getTargetBoostPumpDutyCyclePCT function gets the current target Boost pump + * pwm. + * @details \b Inputs: boostPumpOpenLoopTargetDutyCycle + * @details \b Outputs: none + * @return the current target Boost pwm between 0 and 0.99 + *************************************************************************/ +F32 getTargetBoostPumpDutyCyclePCT( void ) +{ + return boostPumpOpenLoopTargetDutyCycle; +} + +/*********************************************************************//** + * @brief + * The getCurrentBoostPumpDutyCyclePCT function gets the current Boost pump + * pwm. + * @details \b Inputs: none + * @details \b Outputs: none + * @return the current feedback Boost pwm between 0 and 0.99 + *************************************************************************/ +F32 getCurrentBoostPumpDutyCyclePCT( void ) +{ + U16 dutyCyclePct = convertDutyCycleCntToPct( getFluidPumpReadPWMDutyCycle( P40_PUMP ) ); + + return dutyCyclePct; +} + +/*********************************************************************//** + * @brief * The getTargetBoostPumpPressure function gets the current target Boost pump * pressure. * @details \b Inputs: targetBoostPumpPressure