Index: firmware/App/Controllers/AirPump.c =================================================================== diff -u -rcecd0a4cd30e14aa9a193ca3e7bf8a27e7a7e5e4 -ra452377c3d89ff36fa90faef5e3790e2322237a3 --- firmware/App/Controllers/AirPump.c (.../AirPump.c) (revision cecd0a4cd30e14aa9a193ca3e7bf8a27e7a7e5e4) +++ firmware/App/Controllers/AirPump.c (.../AirPump.c) (revision a452377c3d89ff36fa90faef5e3790e2322237a3) @@ -101,7 +101,8 @@ { result = FALSE; } - else if ( state >= AIR_PUMP_STATE_INIT && state < NUM_OF_AIR_PUMP_STATES ) + // unsigned integer never be less than 0 + else if ( state < NUM_OF_AIR_PUMP_STATES ) { currentAirPumpState = state; // power level should be 0 (OFF) when pump state is not ON @@ -286,6 +287,7 @@ BOOL testSetAirPump( MESSAGE_T *message ) { BOOL result = FALSE; + // Verify tester has logged in with TD and override type is valid if ( TRUE == isTestingActivated() ) { Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -rd75a0d1309460169f5d83340ed999307e6411bd8 -ra452377c3d89ff36fa90faef5e3790e2322237a3 --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision d75a0d1309460169f5d83340ed999307e6411bd8) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision a452377c3d89ff36fa90faef5e3790e2322237a3) @@ -370,7 +370,6 @@ static AIR_TRAP_STATE_T handleAirTrapManualControlState( void ) { AIR_TRAP_STATE_T result = AIR_TRAP_MANUAL_CONTROL_STATE; - BOOL setPowerResult; // Transition to valve control states when requested if ( TRUE == pendingStartAirTrapController ) @@ -397,7 +396,6 @@ static AIR_TRAP_STATE_T handleAirTrapClosedState( void ) { AIR_TRAP_STATE_T result = AIR_TRAP_CLOSED_STATE; - BOOL setPowerResult; // Transition to manual control state when requested if ( TRUE == pendingStopAirTrapController ) Index: firmware/App/Drivers/GLXferPump.c =================================================================== diff -u -r4ed766fe84660297858a9af1651e93ff0c4d71f1 -ra452377c3d89ff36fa90faef5e3790e2322237a3 --- firmware/App/Drivers/GLXferPump.c (.../GLXferPump.c) (revision 4ed766fe84660297858a9af1651e93ff0c4d71f1) +++ firmware/App/Drivers/GLXferPump.c (.../GLXferPump.c) (revision a452377c3d89ff36fa90faef5e3790e2322237a3) @@ -73,6 +73,7 @@ void setAirPumpMotorPower( F32 power ) { U08 scalarPower = scalarPowerLevel = convertPercentageToScalar( power ); + // if state is changing, set the air pump to the given on/off state and send event if ( power != currentAirPumpMotorPowerLevel ) { @@ -161,6 +162,7 @@ static U08 convertPercentageToScalar( F32 percentage ) { F32 power; + // Clamp input to 0-100% power = RANGE( percentage, AIR_PUMP_DUTY_CYCLE_MIN, AIR_PUMP_DUTY_CYCLE_MAX );