Index: firmware/App/Controllers/AirPump.c =================================================================== diff -u -r25aeff9e9994d2e7aab3b4e6171c56fdac6a01fe -r6c933adfd50a0bc041dc29f4bfa15de5e9f4843a --- firmware/App/Controllers/AirPump.c (.../AirPump.c) (revision 25aeff9e9994d2e7aab3b4e6171c56fdac6a01fe) +++ firmware/App/Controllers/AirPump.c (.../AirPump.c) (revision 6c933adfd50a0bc041dc29f4bfa15de5e9f4843a) @@ -7,8 +7,8 @@ * * @file AirPump.c * -* @author (last) Varshini Nagabooshanam -* @date (last) 02-Jul-2026 +* @author (last) Santhosh Reddy +* @date (last) 07-Aug-2026 * * @author (original) Sean Nash * @date (original) 19-Sep-2024 @@ -52,7 +52,7 @@ static AIR_PUMP_STATE_T currentAirPumpState; ///< Current air pump control state. static U08 airPumpStallCounter; ///< Air pump stall counter static U08 airPumpStartDelayCounter; ///< Delay before evaluating air pump stall condition -static U16 currentAirPumpRPM; ///< Current air pump RPM +static OVERRIDE_U32_T currentAirPumpRPM; ///< Current air pump RPM static F32 currentAirPumpPowerLevel; ///< Current air pump power level setting in % duty cycle (0..100%). static U32 airPumpDataPublicationTimerCounter; ///< Air pump data broadcast timer counter. static OVERRIDE_U32_T airPumpDataPublishInterval; ///< Air pump data broadcast interval (in ms). @@ -81,7 +81,10 @@ airPumpDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; currentAirPumpState = AIR_PUMP_STATE_INIT; currentAirPumpPowerLevel = AIR_PUMP_MOTOR_OFF; - currentAirPumpRPM = 0; + currentAirPumpRPM.data = 0; + currentAirPumpRPM.ovData = 0; + currentAirPumpRPM.ovInitData = 0; + currentAirPumpRPM.override = OVERRIDE_RESET; airPumpStallCounter = 0; airPumpStartDelayCounter = 0; airPumpDataPublishInterval.data = AIR_PUMP_DATA_PUB_INTERVAL; @@ -179,7 +182,7 @@ // Check stall condition checkAirPumpStallCondition(); // update the speed every tick - currentAirPumpRPM = getAirPumpMotorRPM(); + currentAirPumpRPM.data = (U32)getAirPumpMotorRPM(); publishAirPumpData(); } @@ -255,12 +258,14 @@ airPumpStartDelayCounter++; airPumpStallCounter = 0; } - else if ( 0 == currentAirPumpRPM ) + else if ( 0 == getU32OverrideValue( ¤tAirPumpRPM ) ) { // Air pump commanded on but RPM remains zero if ( ++airPumpStallCounter >= AIR_PUMP_STALL_PERSISTENCE ) { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_AIR_PUMP_STALL, currentAirPumpPowerLevel, currentAirPumpRPM ); + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_AIR_PUMP_STALL, + currentAirPumpPowerLevel, + getU32OverrideValue( ¤tAirPumpRPM ) ); // Stop H12 air pump setAirPumpState( AIR_PUMP_STATE_OFF, AIR_PUMP_MOTOR_OFF ); } @@ -300,7 +305,7 @@ data.h12State = getAirPumpState(); data.h12Power = currentAirPumpPowerLevel; - data.h12Rpm = (U32)currentAirPumpRPM; + data.h12Rpm = getU32OverrideValue( ¤tAirPumpRPM ); //TODO:remove after validating pump speed data.fpgah12Rpm = getAirPumpMotorFPGARPM(); //TODO:remove after validating pump speed @@ -365,5 +370,22 @@ return result; } +/*********************************************************************//** + * @brief + * The testAirPumpRPMOverride function overrides the RPM value reported + * by the air pump sensor. + * @details \b Inputs: none + * @details \b Outputs: currentAirPumpRPM + * @param message Override message from Dialin which includes the RPM + * value to override the air pump RPM to. + * @return TRUE if override request is successful, FALSE if not + *************************************************************************/ +BOOL testAirPumpRPMOverride( MESSAGE_T *message ) +{ + BOOL result = u32Override( message, ¤tAirPumpRPM, 0, 0xFFFF ); + + return result; +} + /**@}*/