Index: firmware/App/Monitors/Conductivity.c =================================================================== diff -u -rc90f3d61bde2a2b47d1048635be4dadf282e2195 -ra03a5119712cea509ec345bd4f650ffcdb9a9438 --- firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision c90f3d61bde2a2b47d1048635be4dadf282e2195) +++ firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision a03a5119712cea509ec345bd4f650ffcdb9a9438) @@ -283,6 +283,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 ) { @@ -293,7 +294,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; } } } @@ -371,6 +371,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 ) { @@ -381,7 +382,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; } } }