Index: firmware/App/Monitors/Conductivity.c =================================================================== diff -u -r18d4fec0e495fa16ec6569980b43fc5c214024ed -reaeff603027c54d0be5171d519710942672ef623 --- firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision 18d4fec0e495fa16ec6569980b43fc5c214024ed) +++ firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision eaeff603027c54d0be5171d519710942672ef623) @@ -8,7 +8,7 @@ * @file Conductivity.c * * @author (last) Michael Garthwaite -* @date (last) 06-Mar-2026 +* @date (last) 09-Apr-2026 * * @author (original) Vinayakam Mani * @date (original) 13-Sep-2024 @@ -35,8 +35,8 @@ #define COND_SENSOR_REPORT_PERIOD ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Broadcast conductivity values message every second. #define COND_SENSOR_UPDATE_INTERVAL ( 700 / TASK_PRIORITY_INTERVAL ) ///< Time in task intervals for new sensor data #define DATA_PUBLISH_COUNTER_START_COUNT 40 ///< Data publish counter start count. -#define CONDUCTIVITY_SAMPLE_FILTER_MS ( 500 ) ///< Filter conductivity data for given time -#define CONDUCTIVITY_TEMP_SAMPLE_FILTER_MS ( 500 ) ///< Filter conductivity temperature data for given time +#define CONDUCTIVITY_SAMPLE_FILTER_MS ( 30 ) ///< Filter conductivity data for given time +#define CONDUCTIVITY_TEMP_SAMPLE_FILTER_MS ( 30 ) ///< Filter conductivity temperature data for given time #define SIZE_OF_COND_ROLLING_AVG ( CONDUCTIVITY_SAMPLE_FILTER_MS / TASK_PRIORITY_INTERVAL ) ///< Filtered conductivity moving average sample count. #define SIZE_OF_COND_TEMP_ROLLING_AVG ( CONDUCTIVITY_TEMP_SAMPLE_FILTER_MS / TASK_PRIORITY_INTERVAL ) ///< Filtered conductivity temprature moving average sample count. #define RO_RR_MOVING_AVG_NUM_OF_SAMPLES 30 ///< RO rejection ratio moving average number of samples. @@ -252,12 +252,20 @@ if ( ++condSampleIntervalCounter >= condDataCollectionTimeInterval ) { + for ( sensor = FIRST_DD_COND_SENSOR; sensor < NUM_OF_CONDUCTIVITY_SENSORS; sensor++ ) { if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) != TRUE ) { - calculatedConductivity = getTeensyConductivityValue( sensor ); + if ( sensor != D74_COND ) + { + calculatedConductivity = getTeensyConductivityValue( sensor ); + } + else + { + calculatedConductivity = getConductivity( sensor ); + } } else { @@ -276,7 +284,9 @@ filteredConductivityReadings[ sensor ].conductivityReadingsCount = INC_CAP( filteredConductivityReadings[ sensor ].conductivityReadingsCount, SIZE_OF_COND_ROLLING_AVG ); filteredcurrentConductivityReadings[ sensor ].data = filteredConductivityReadings[ sensor ].conductivityReadingsTotal / (F32)filteredConductivityReadings[ sensor ].conductivityReadingsCount; } + condSampleIntervalCounter = 0; + } } @@ -326,6 +336,7 @@ if ( ++condtempSampleIntervalCounter >= condtempDataCollectionTimeInterval ) { + for ( sensor = FIRST_DD_COND_SENSOR; sensor < NUM_OF_CONDUCTIVITY_SENSORS; sensor++ ) { // Filter conductivity temp @@ -352,6 +363,7 @@ } condtempSampleIntervalCounter = 0; + } }