Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -re6471488a8342e5b23f8a4dc977980e1e442d923 -rcadfc15e18c31627b48eb03787479e2a6a1c3fef --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision e6471488a8342e5b23f8a4dc977980e1e442d923) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision cadfc15e18c31627b48eb03787479e2a6a1c3fef) @@ -68,7 +68,7 @@ /// Interval (in ms) at which to publish air trap data to CAN bus. static OVERRIDE_U32_T airTrapDataPublishInterval = { AIR_TRAP_DATA_PUB_INTERVAL, AIR_TRAP_DATA_PUB_INTERVAL, AIR_TRAP_DATA_PUB_INTERVAL, 0 }; static OVERRIDE_U32_T airTrapLevels[ NUM_OF_AIR_TRAP_LEVEL_SENSORS ]; ///< Detected air trap level for each level sensor. -static OVERRIDE_U32_T rawAirTrapLevels[ NUM_OF_AIR_TRAP_LEVEL_SENSORS ]; ///< raw air trap level before debouncing time +static OVERRIDE_U32_T rawAirTrapLevels[ NUM_OF_AIR_TRAP_LEVEL_SENSORS ]; ///< Raw air trap level before debouncing time static U32 airTrapLevelsDebounceStartTime[ NUM_OF_AIR_TRAP_LEVEL_SENSORS ]; ///< Debounce start time for airtrap level sensor. static BOOL pendingStartAirTrapController = FALSE; ///< Flag indicates an air trap controller start request is pending. @@ -208,7 +208,7 @@ for( airTrapLevelSensor = AIR_TRAP_LEVEL_SENSOR_LOWER; airTrapLevelSensor < NUM_OF_AIR_TRAP_LEVEL_SENSORS; airTrapLevelSensor++ ) { // Check if the raw level sensor status is not the same as the recorded data - if ( rawAirTrapLevels[ airTrapLevelSensor ].data != airTrapLevels[ airTrapLevelSensor ].data ) + if ( getRawAirTrapLevel( airTrapLevelSensor ) != (AIR_TRAP_LEVELS_T)airTrapLevels[ airTrapLevelSensor ].data ) { // If the debounce time is 0, start the timer if ( 0 == airTrapLevelsDebounceStartTime[ airTrapLevelSensor ] ) @@ -221,7 +221,7 @@ // reset the debounce time airTrapLevelsDebounceStartTime[ airTrapLevelSensor ] = 0; // update recent level status - airTrapLevels[ airTrapLevelSensor ].data = rawAirTrapLevels[ airTrapLevelSensor ].data; + airTrapLevels[ airTrapLevelSensor ].data = (U32)getRawAirTrapLevel( airTrapLevelSensor ); } } else