Index: firmware/App/Monitors/Conductivity.c =================================================================== diff -u -r145fd716a856f864f39fb0f9884865f6e45b9256 -r67d2fdfc9ec326b98b5a0ac2dbfcee283c8791af --- firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision 145fd716a856f864f39fb0f9884865f6e45b9256) +++ firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision 67d2fdfc9ec326b98b5a0ac2dbfcee283c8791af) @@ -7,8 +7,8 @@ * * @file Conductivity.c * -* @author (last) Sameer Kalliadan Poyil -* @date (last) 16-Jun-2026 +* @author (last) Michael Garthwaite +* @date (last) 08-Jul-2026 * * @author (original) Vinayakam Mani * @date (original) 13-Sep-2024 @@ -17,12 +17,14 @@ #include // Used for calculating the polynomial calibration equation. #include // For memcpy +#include "BalancingChamber.h" #include "Conductivity.h" #include "MessageSupport.h" #include "Messaging.h" #include "ModeGenPermeate.h" #include "OperationModes.h" #include "TaskPriority.h" +#include "TDInterface.h" #include "Utilities.h" /** @@ -38,9 +40,9 @@ #define FP_CONDUCTIVITY_DATA_PUBLISH_COUNTER_START_COUNT 41 ///< FP Conductivity data publish counter start count. #define RO_DATA_PUBLISH_COUNTER_START_COUNT 42 ///< FP RO Data publish counter start count. #define RESISTANCE_DATA_PUBLISH_COUNTER_START_COUNT 43 ///< DD Resistance data publish counter start count. -#define CONDUCTIVITY_SAMPLE_FILTER_MS ( 210 ) ///< Filter conductivity data for given time. Currently set to have 5 samples over 3.5s ( 700ms sample rate ) -#define CONDUCTIVITY_TEMP_SAMPLE_FILTER_MS ( 30 ) ///< Filter conductivity temperature data for given time. Currently set to have 5 samples over 3.5s ( 700ms sample rate ) -#define SIZE_OF_COND_ROLLING_AVG ( CONDUCTIVITY_SAMPLE_FILTER_MS / TASK_PRIORITY_INTERVAL ) ///< Filtered conductivity moving average sample count. +#define CONDUCTIVITY_MAX_FILTER_SIZE_MULTIPLIER ( 252 ) ///< Maximum conductivity filter sample count (At 50qd, we switch once for every 36sec, so 36 * FILTER_SIZE_MULTIPLIER = 252). +#define CONDUCTIVITY_TEMP_SAMPLE_FILTER_MS ( 3 * TASK_PRIORITY_INTERVAL ) ///< Conductivity temperature filter scale (ms). Rolling avg size = FILTER_MS / TASK_PRIORITY_INTERVAL = 3 samples (3 * TASK_PRIORITY_INTERVAL(10) = 30). At 700 ms sensor update rate, 3 * 700 ms ≈ 2.1 s window. +#define FILTER_SIZE_MULTIPLIER ( 7 ) ///< Conductivity filter size multiplier. #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. #define FRACTION_TO_PERCENT_CONVERSION_FACTOR 100.0F ///< RO rejection ratio factor to percentage conversion factor value @@ -49,7 +51,7 @@ /// Filter conductivity readings record. typedef struct { - F32 conductivityReadings[ SIZE_OF_COND_ROLLING_AVG ]; ///< Holds conductivity sample rolling average. + F32 conductivityReadings[ CONDUCTIVITY_MAX_FILTER_SIZE_MULTIPLIER ]; ///< Holds conductivity sample rolling average. U32 conductivityReadingsIdx; ///< Index for next sample in rolling average array. F32 conductivityReadingsTotal; ///< Rolling total - used to calc average. U32 conductivityReadingsCount; ///< Number of samples in rolling average buffer @@ -66,29 +68,30 @@ // ********** private data ********** -static U08 condPrevReadCount[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Previous read count for conductivity per sensor -static U08 condTempPrevReadCount[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Previous read count for temperature per sensor. -static FILTER_CONDUCTIVITY_READINGS_T filteredConductivityReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Filtered conductivity reading for conductivity sensors. -static OVERRIDE_F32_T filteredcurrentConductivityReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< filtered current conductivity sensor conductivity readings (overrideable). -static FILTER_CONDUCTIVITY_TEMPERATURE_READINGS_T filteredConductivityTemperatureReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Filtered temperature reading for conductivity sensors. -static OVERRIDE_F32_T filteredcurrentTemperatureReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< filtered current conductivity sensor temperature readings (overrideable). -static U32 ddConductivityPublishTimerCounter; ///< DD Conductivity data publication counter. -static OVERRIDE_U32_T ddConductivityDataPublishInterval; ///< DD Conductivity sensors publish time interval override. -static U32 fpConductivityPublishTimerCounter; ///< FP Conductivity data publication counter. -static OVERRIDE_U32_T fpConductivityDataPublishInterval; ///< FP Conductivity sensors publish time interval override. -static F32 roRejectionRatio; ///< All time RO rejection ratio. -static F32 roRejectionRatioTankFill; ///< RO rejection ratio during permeate tank fill state. -static U32 roRRPublishTimerCounter; ///< RO rejection ratio publication counter. -static OVERRIDE_U32_T roRRDataPublishInterval; ///< RO rejection ratio publish time interval override. -static OVERRIDE_F32_T roRRAvg; ///< Average RO rejection ratio. -static F32 roRRRunningSum; ///< RO rejection ratio running sum. -static F32 roRRSamples[ RO_RR_MOVING_AVG_NUM_OF_SAMPLES ]; ///< RO rejection ratio samples array. -static U32 roRRSamplesNextIndex; ///< RO rejection ratio sample next index number. -static U32 roRRCount; ///< RO rejection ratio Number of samples in average buffer. -static F32 roRRTankFillAvg; ///< Average RO rejection ratio during permeate tank fill state. -static U32 roRRSampleIntervalCounter; ///< RO rejection ratio sample collection timer counter. -static U32 conductivityResistancePublishTimerCounter; ///< DD and FP Conductivity data publication counter. -static OVERRIDE_U32_T conductivityResistanceDataPublishInterval; ///< DD and FP Conductivity sensors publish time interval override. +static U08 condPrevReadCount[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Previous read count for conductivity per sensor +static U08 condTempPrevReadCount[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Previous read count for temperature per sensor. +static FILTER_CONDUCTIVITY_READINGS_T filteredConductivityReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Filtered conductivity reading for conductivity sensors. +static FILTER_CONDUCTIVITY_READINGS_T filteredUConductivityReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Filtered conductivity readings without temperature compensation +static OVERRIDE_F32_T filteredcurrentUConductivityReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Filtered current conductivity sensor conductivity readings (overrideable). +static OVERRIDE_F32_T filteredcurrentConductivityReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Filtered current conductivity sensor conductivity readings (overrideable). +static FILTER_CONDUCTIVITY_TEMPERATURE_READINGS_T filteredConductivityTemperatureReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Filtered temperature reading for conductivity sensors. +static OVERRIDE_F32_T filteredcurrentTemperatureReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< filtered current conductivity sensor temperature readings (overrideable). +static U32 ddConductivityPublishTimerCounter; ///< DD Conductivity data publication counter. +static OVERRIDE_U32_T ddConductivityDataPublishInterval; ///< DD Conductivity sensors publish time interval override. +static U32 fpConductivityPublishTimerCounter; ///< FP Conductivity data publication counter. +static OVERRIDE_U32_T fpConductivityDataPublishInterval; ///< FP Conductivity sensors publish time interval override. +static F32 roRejectionRatio; ///< All time RO rejection ratio. +static F32 roRejectionRatioTankFill; ///< RO rejection ratio during permeate tank fill state. +static U32 roRRPublishTimerCounter; ///< RO rejection ratio publication counter. +static OVERRIDE_U32_T roRRDataPublishInterval; ///< RO rejection ratio publish time interval override. +static OVERRIDE_F32_T roRRAvg; ///< Average RO rejection ratio. +static F32 roRRRunningSum; ///< RO rejection ratio running sum. +static F32 roRRSamples[ RO_RR_MOVING_AVG_NUM_OF_SAMPLES ]; ///< RO rejection ratio samples array. +static U32 roRRSamplesNextIndex; ///< RO rejection ratio sample next index number. +static U32 roRRCount; ///< RO rejection ratio Number of samples in average buffer. +static F32 roRRTankFillAvg; ///< Average RO rejection ratio during permeate tank fill state. +static U32 roRRSampleIntervalCounter; ///< RO rejection ratio sample collection timer counter. +static U32 conductivityFilterSize; ///< Active conductivity filter sample count. // ********** private function prototypes ********** @@ -99,6 +102,8 @@ static void calcRORejectionRatio( void ); static void filterRORejectionRatioReadings( void ); static void broadcastResistanceData( void ); +static U32 getConductivityFilterSize( void ); +static void resetConductivityFilterReadings( void ); /*********************************************************************//** * @brief @@ -117,7 +122,6 @@ ddConductivityPublishTimerCounter = DD_CONDUCTIVITY_DATA_PUBLISH_COUNTER_START_COUNT; fpConductivityPublishTimerCounter = FP_CONDUCTIVITY_DATA_PUBLISH_COUNTER_START_COUNT; roRRPublishTimerCounter = RO_DATA_PUBLISH_COUNTER_START_COUNT; - conductivityResistancePublishTimerCounter = RESISTANCE_DATA_PUBLISH_COUNTER_START_COUNT; roRejectionRatio = 0.0F; roRejectionRatioTankFill = 0.0F; roRRRunningSum = 0.0F; @@ -129,12 +133,22 @@ roRRAvg.ovInitData = 0.0F; roRRAvg.override = OVERRIDE_RESET; roRRSampleIntervalCounter = 0; + conductivityFilterSize = FILTER_SIZE_MULTIPLIER; memset( &roRRSamples, 0, sizeof( roRRSamples ) ); // Initialize override structures for each conductivity sensor for ( sensor = FIRST_DD_COND_SENSOR; sensor < NUM_OF_CONDUCTIVITY_SENSORS; sensor++ ) { + filteredcurrentUConductivityReadings[ sensor ].data = 0.0F; + filteredcurrentUConductivityReadings[ sensor ].ovData = 0.0F; + filteredcurrentUConductivityReadings[ sensor ].ovInitData = 0.0F; + filteredcurrentUConductivityReadings[ sensor ].override = OVERRIDE_RESET; + + filteredUConductivityReadings[ sensor ].conductivityReadingsIdx = 0; + filteredUConductivityReadings[ sensor ].conductivityReadingsTotal = 0.0F; + filteredUConductivityReadings[ sensor ].conductivityReadingsCount = 0; + filteredcurrentConductivityReadings[ sensor ].data = 0.0F; filteredcurrentConductivityReadings[ sensor ].ovData = 0.0F; filteredcurrentConductivityReadings[ sensor ].ovInitData = 0.0F; @@ -171,12 +185,6 @@ roRRDataPublishInterval.ovData = COND_SENSOR_REPORT_PERIOD; roRRDataPublishInterval.ovInitData = 0; roRRDataPublishInterval.override = OVERRIDE_RESET; - - conductivityResistanceDataPublishInterval.data = COND_SENSOR_REPORT_PERIOD; - conductivityResistanceDataPublishInterval.ovData = COND_SENSOR_REPORT_PERIOD; - conductivityResistanceDataPublishInterval.ovInitData = 0; - conductivityResistanceDataPublishInterval.override = OVERRIDE_RESET; - } /*********************************************************************//** @@ -249,6 +257,35 @@ /*********************************************************************//** * @brief + * The getFilteredUConductivity function gets the filtered current conductivity (in uS/cm) + * for a given conductivity sensor. + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT if given sensor is invalid. + * @details \b Inputs: filteredcurrentConductivityReadings[] + * @details \b Outputs: none + * @param sensor ID of conductivity sensor to get filtered conductivity reading for. + * @return The filtered current conductivity (in uS/cm) for the given conductivity sensor + *************************************************************************/ +F32 getFilteredUConductivity( CONDUCTIVITY_SENSORS_T sensor ) +{ + F32 result = 0.0F; + + if ( sensor < NUM_OF_CONDUCTIVITY_SENSORS ) + { + result = filteredcurrentUConductivityReadings[ sensor ].data; + if ( OVERRIDE_KEY == filteredcurrentUConductivityReadings[ sensor ].override ) + { + result = filteredcurrentUConductivityReadings[ sensor ].ovData; + } + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_FILTERED_CONDUCTIVITY_SENSOR_ID, (U32)sensor ) + } + + return result; +} +/*********************************************************************//** + * @brief * The filterConductivitySensorReadings function filters the conductivity rates for * defined interval to get average conductivity rates. * @details \b Inputs: filteredConductivityReadings[] @@ -259,8 +296,16 @@ { CONDUCTIVITY_SENSORS_T sensor; F32 calculatedConductivity = 0.0F; + U32 activeFilterSize = getConductivityFilterSize(); + F32 uncompenstatedConductivity = 0.0F; BOOL freshData = FALSE; + if ( conductivityFilterSize != activeFilterSize ) + { + conductivityFilterSize = activeFilterSize; + resetConductivityFilterReadings(); + } + for ( sensor = FIRST_DD_COND_SENSOR; sensor < NUM_OF_CONDUCTIVITY_SENSORS; sensor++ ) { if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) == TRUE ) @@ -282,6 +327,7 @@ if ( condPrevReadCount[ sensor ] != getConductivityReadCount( sensor ) ) { calculatedConductivity = getConductivity( sensor ); + uncompenstatedConductivity = getUncompensatedConductivity( sensor ); condPrevReadCount[ sensor ] = getConductivityReadCount( sensor ); freshData = TRUE; } @@ -292,21 +338,101 @@ { freshData = FALSE; // TODO - calibrate - if ( filteredConductivityReadings[ sensor ].conductivityReadingsCount >= SIZE_OF_COND_ROLLING_AVG ) + if ( filteredConductivityReadings[ sensor ].conductivityReadingsCount >= conductivityFilterSize ) { filteredConductivityReadings[ sensor ].conductivityReadingsTotal -= filteredConductivityReadings[ sensor ].conductivityReadings[ filteredConductivityReadings[ sensor ].conductivityReadingsIdx ]; } filteredConductivityReadings[ sensor ].conductivityReadings[ filteredConductivityReadings[ sensor ].conductivityReadingsIdx ] = calculatedConductivity; filteredConductivityReadings[ sensor ].conductivityReadingsTotal += calculatedConductivity; - 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 ); + filteredConductivityReadings[ sensor ].conductivityReadingsIdx = INC_WRAP( filteredConductivityReadings[ sensor ].conductivityReadingsIdx, 0, conductivityFilterSize - 1 ); + filteredConductivityReadings[ sensor ].conductivityReadingsCount = INC_CAP( filteredConductivityReadings[ sensor ].conductivityReadingsCount, conductivityFilterSize ); filteredcurrentConductivityReadings[ sensor ].data = filteredConductivityReadings[ sensor ].conductivityReadingsTotal / (F32)filteredConductivityReadings[ sensor ].conductivityReadingsCount; + + if ( filteredUConductivityReadings[ sensor ].conductivityReadingsCount >= conductivityFilterSize ) + { + filteredUConductivityReadings[ sensor ].conductivityReadingsTotal -= filteredUConductivityReadings[ sensor ].conductivityReadings[ filteredUConductivityReadings[ sensor ].conductivityReadingsIdx ]; + } + filteredUConductivityReadings[ sensor ].conductivityReadings[ filteredUConductivityReadings[ sensor ].conductivityReadingsIdx ] = uncompenstatedConductivity; + filteredUConductivityReadings[ sensor ].conductivityReadingsTotal += uncompenstatedConductivity; + filteredUConductivityReadings[ sensor ].conductivityReadingsIdx = INC_WRAP( filteredUConductivityReadings[ sensor ].conductivityReadingsIdx, 0, conductivityFilterSize - 1 ); + filteredUConductivityReadings[ sensor ].conductivityReadingsCount = INC_CAP( filteredUConductivityReadings[ sensor ].conductivityReadingsCount, conductivityFilterSize ); + filteredcurrentUConductivityReadings[ sensor ].data = filteredUConductivityReadings[ sensor ].conductivityReadingsTotal / (F32)filteredUConductivityReadings[ sensor ].conductivityReadingsCount; + } } } /*********************************************************************//** * @brief + * The getConductivityFilterSize function gets the active conductivity filter + * sample count based on the Qd balancing chamber switching period. + * @details \b Inputs: TD dialysate flow rate + * @details \b Outputs: none + * @return active conductivity filter sample count. + *************************************************************************/ +static U32 getConductivityFilterSize( void ) +{ + F32 tdDialysateFlowRate = getTDDialysateFlowrate(); + U32 result = FILTER_SIZE_MULTIPLIER; + + if ( tdDialysateFlowRate > NEARLY_ZERO ) + { + F32 balChamberSwitchingFreq = tdDialysateFlowRate / BAL_CHAMBER_FILL_VOLUME_ML; + F32 balChamberSwitchingPeriod = (F32)SEC_PER_MIN / balChamberSwitchingFreq; + + result = (U32)( (F32)FILTER_SIZE_MULTIPLIER * balChamberSwitchingPeriod ); + } + + return result; +} + +/*********************************************************************//** + * @brief + * The resetConductivityFilterReadings function clears conductivity rolling + * average data when the active filter window changes. + * @details \b Inputs: filteredConductivityReadings + * @details \b Outputs: filteredConductivityReadings + * @return none + *************************************************************************/ +static void resetConductivityFilterReadings( void ) +{ + CONDUCTIVITY_SENSORS_T sensor; + + for ( sensor = FIRST_DD_COND_SENSOR; sensor < NUM_OF_CONDUCTIVITY_SENSORS; sensor++ ) + { + U32 readingIndex; + + F32 seedConductivity = filteredcurrentConductivityReadings[ sensor ].data; + BOOL hasPreviousSamples = ( filteredConductivityReadings[ sensor ].conductivityReadingsCount > 0 ); + + for ( readingIndex = 0; readingIndex < CONDUCTIVITY_MAX_FILTER_SIZE_MULTIPLIER; readingIndex++ ) + { + if ( ( TRUE == hasPreviousSamples ) && ( readingIndex < conductivityFilterSize ) ) + { + filteredConductivityReadings[ sensor ].conductivityReadings[ readingIndex ] = seedConductivity; + } + else + { + filteredConductivityReadings[ sensor ].conductivityReadings[ readingIndex ] = 0.0F; + } + } + + filteredConductivityReadings[ sensor ].conductivityReadingsIdx = 0; + if ( TRUE == hasPreviousSamples ) + { + filteredConductivityReadings[ sensor ].conductivityReadingsTotal = seedConductivity * (F32)conductivityFilterSize; + filteredConductivityReadings[ sensor ].conductivityReadingsCount = conductivityFilterSize; + } + else + { + filteredConductivityReadings[ sensor ].conductivityReadingsTotal = 0.0F; + filteredConductivityReadings[ sensor ].conductivityReadingsCount = 0; + } + } +} + +/*********************************************************************//** + * @brief * The getFilteredConductivitySensorTemperature function gets the filtered * temperature (in C) for a given conductivity sensor. * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT if given sensor is invalid. @@ -529,6 +655,22 @@ data.d29Cond = getFilteredConductivity( D29_COND ); data.d43Cond = getFilteredConductivity( D43_COND ); data.d74Cond = getFilteredConductivity( D74_COND ); + data.d17CondResist = getConductivityRawResistance( D17_COND ); + data.d27CondResist = getConductivityRawResistance( D27_COND ); + data.d29CondResist = getConductivityRawResistance( D29_COND ); + data.d43CondResist = getConductivityRawResistance( D43_COND ); + data.d74CondResist = getConductivityRawResistance( D74_COND ); + data.d17RTDResist = getConductivityRawRTD( D17_COND ); + data.d27RTDResist = getConductivityRawRTD( D27_COND ); + data.d29RTDResist = getConductivityRawRTD( D29_COND ); + data.d43RTDResist = getConductivityRawRTD( D43_COND ); + data.d74RTDResist = getConductivityRawRTD( D74_COND ); + data.d17CondUncomp = getFilteredUConductivity( D17_COND ); + data.d27CondUncomp = getFilteredUConductivity( D27_COND ); + data.d29CondUncomp = getFilteredUConductivity( D29_COND ); + data.d43CondUncomp = getFilteredUConductivity( D43_COND ); + data.d74CondUncomp = getFilteredUConductivity( D74_COND ); + ddConductivityPublishTimerCounter = 0; broadcastData( MSG_ID_DD_CONDUCTIVITY_DATA, COMM_BUFFER_OUT_CAN_DD_BROADCAST, (U08*)&data, sizeof( DD_CONDUCTIVITY_DATA_T ) ); @@ -541,6 +683,12 @@ data.p9Conductivity = getFilteredConductivity( P9_COND ); data.p18Conductivity = getFilteredConductivity( P18_COND ); + data.p9CondResist = getConductivityRawResistance( P9_COND ); + data.p18CondResist = getConductivityRawResistance( P18_COND ); + data.p9RTDResist = getConductivityRawRTD( P9_COND ); + data.p18RTDResist = getConductivityRawRTD( P18_COND ); + data.p9CondUncomp = getFilteredUConductivity( P9_COND ); + data.p18CondUncomp = getFilteredUConductivity( P18_COND ); fpConductivityPublishTimerCounter = 0; broadcastData( MSG_ID_FP_CONDUCTIVITY_DATA, COMM_BUFFER_OUT_CAN_FP_BROADCAST, (U08*)&data, sizeof( FP_CONDUCTIVITY_DATA_T ) ); @@ -560,50 +708,9 @@ broadcastData( MSG_ID_FP_RO_REJECTION_RATIO_DATA, COMM_BUFFER_OUT_CAN_FP_BROADCAST, (U08*)&data, sizeof( RO_REJECTION_RATIO_DATA_T ) ); } - - if ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) ) - { - // publish conductivity resistance data on interval - if ( ++conductivityResistancePublishTimerCounter >= getU32OverrideValue( &conductivityResistanceDataPublishInterval ) ) - { - broadcastResistanceData(); - } - } } -/*********************************************************************//** - * @brief - * The broadcastResistanceData function publishes DD resistance data. - * @details \b Inputs: conductivityResistancePublishTimerCounter - * @details \b Outputs: resistance data - * roRRPublishTimerCounter, DD & FP resistance data is sent - * @details \b Message \b Sent: MSG_ID_DD_CONDUCTIVITY_SENSOR_RESISTANCE_DATA to publish DD resistance data. - * @return none - *************************************************************************/ -static void broadcastResistanceData( void ) -{ - CONDUCTIVITY_RESISTANCE_DATA_T data; - data.d17CondResist = getConductivityRawResistance( D17_COND ); - data.d27CondResist = getConductivityRawResistance( D27_COND ); - data.d29CondResist = getConductivityRawResistance( D29_COND ); - data.d43CondResist = getConductivityRawResistance( D43_COND ); - data.d74CondResist = getConductivityRawResistance( D74_COND ); - data.p9CondResist = getConductivityRawResistance( P9_COND ); - data.p18CondResist = getConductivityRawResistance( P18_COND ); - data.d17RTDResist = getConductivityRawRTD( D17_COND ); - data.d27RTDResist = getConductivityRawRTD( D27_COND ); - data.d29RTDResist = getConductivityRawRTD( D29_COND ); - data.d43RTDResist = getConductivityRawRTD( D43_COND ); - data.d74RTDResist = getConductivityRawRTD( D74_COND ); - data.p9RTDResist = getConductivityRawRTD( P9_COND ); - data.p18RTDResist = getConductivityRawRTD( P18_COND ); - conductivityResistancePublishTimerCounter = 0; - - broadcastData( MSG_ID_DD_CONDUCTIVITY_SENSOR_RESISTANCE_DATA, COMM_BUFFER_OUT_CAN_DD_BROADCAST, (U08*)&data, sizeof( CONDUCTIVITY_RESISTANCE_DATA_T ) ); - -} - /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/