Index: firmware/App/Monitors/Conductivity.c =================================================================== diff -u -ra7af93efacb700dc80504906356851e9991ba3b1 -rb085a36e252a01504b415bf145e4b1fc129cdcdf --- firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision a7af93efacb700dc80504906356851e9991ba3b1) +++ firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision b085a36e252a01504b415bf145e4b1fc129cdcdf) @@ -277,6 +277,7 @@ // Apply sample to filter if we know it's fresh, v2/v3 only. V1's will always update filter regardless of freshness. if ( TRUE == freshData ) { + freshData = FALSE; // TODO - calibrate if ( filteredConductivityReadings[ sensor ].conductivityReadingsCount >= SIZE_OF_COND_ROLLING_AVG ) { @@ -287,7 +288,6 @@ filteredConductivityReadings[ sensor ].conductivityReadingsIdx = INC_WRAP( filteredConductivityReadings[ sensor ].conductivityReadingsIdx, 0, SIZE_OF_COND_ROLLING_AVG - 1 ); filteredConductivityReadings[ sensor ].conductivityReadingsCount = INC_CAP( filteredConductivityReadings[ sensor ].conductivityReadingsCount, SIZE_OF_COND_ROLLING_AVG ); filteredcurrentConductivityReadings[ sensor ].data = filteredConductivityReadings[ sensor ].conductivityReadingsTotal / (F32)filteredConductivityReadings[ sensor ].conductivityReadingsCount; - freshData = FALSE; } } } @@ -365,6 +365,7 @@ // Apply sample to filter if we know it's fresh, v2/v3 only. V1's will always update filter regardless of freshness. if ( TRUE == freshData ) { + freshData = FALSE; // TODO - calibrate if ( filteredConductivityTemperatureReadings[sensor].conductivityTempReadingsCount >= SIZE_OF_COND_TEMP_ROLLING_AVG ) { @@ -375,7 +376,6 @@ filteredConductivityTemperatureReadings[sensor].conductivityTempReadingsIdx = INC_WRAP( filteredConductivityTemperatureReadings[sensor].conductivityTempReadingsIdx, 0, SIZE_OF_COND_TEMP_ROLLING_AVG - 1 ); filteredConductivityTemperatureReadings[sensor].conductivityTempReadingsCount = INC_CAP( filteredConductivityTemperatureReadings[sensor].conductivityTempReadingsCount, SIZE_OF_COND_TEMP_ROLLING_AVG ); filteredcurrentTemperatureReadings[sensor].data = filteredConductivityTemperatureReadings[sensor].conductivityTempReadingsTotal / (F32)filteredConductivityTemperatureReadings[sensor].conductivityTempReadingsCount; - freshData = FALSE; } } }