Index: firmware/App/Drivers/ConductivitySensors.c =================================================================== diff -u -r55addba733659d02ddabf09bfc0af7c8f69fd50a -r44d7a987b5c6b91396ddb2cc8163b36c21f59bde --- firmware/App/Drivers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 55addba733659d02ddabf09bfc0af7c8f69fd50a) +++ firmware/App/Drivers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 44d7a987b5c6b91396ddb2cc8163b36c21f59bde) @@ -104,6 +104,7 @@ // ********** private data ********** static CONDUCTIVITY_STATE_T currentConductivityState; ///< Current conductivity sensor state. +static OVERRIDE_F32_T currentUncompenstatedConductivityReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< TODO: Get Vinay or Sean to tell me to remove this debug array in CR. static OVERRIDE_F32_T currentConductivityReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Current conductivity sensor conductivity readings (overrideable). static OVERRIDE_F32_T currentTemperatureReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Current conductivity sensor temperature readings (overrideable). static OVERRIDE_U32_T lastConductivityReadCounter[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Last conductivity sensor read count (Overrideable). @@ -146,6 +147,11 @@ // Initialize override structures for each conductivity sensor for ( sensor = FIRST_DD_COND_SENSOR; sensor < NUM_OF_CONDUCTIVITY_SENSORS; sensor++ ) { + currentUncompenstatedConductivityReadings[ sensor ].data = 0.0F; + currentUncompenstatedConductivityReadings[ sensor ].ovData = 0.0F; + currentUncompenstatedConductivityReadings[ sensor ].ovInitData = 0.0F; + currentUncompenstatedConductivityReadings[ sensor ].override = OVERRIDE_RESET; + currentConductivityReadings[ sensor ].data = 0.0F; currentConductivityReadings[ sensor ].ovData = 0.0F; currentConductivityReadings[ sensor ].ovInitData = 0.0F; @@ -552,7 +558,7 @@ { isFPSensor = TRUE; } - + calculateConductivityUpdatedStandard( sensor, isFPSensor ); calculateConductivityUpdatedStandardTempCompensated( sensor, isFPSensor ); } @@ -887,6 +893,35 @@ /*********************************************************************//** * @brief + * The getUncompensatedConductivity function gets the conductivity + * value for a given conductivity sensor id. + * @details \b Inputs: currentUncompenstatedConductivityReadings[] + * @details \b Outputs: none + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT if given sensor is invalid. + * @param sensorId conductivity sensor id + * @return conductivity value + *************************************************************************/ +F32 getUncompensatedConductivity( CONDUCTIVITY_SENSORS_T sensor ) +{ + F32 result = 0.0F; + + if ( sensor < NUM_OF_CONDUCTIVITY_SENSORS ) + { + result = currentUncompenstatedConductivityReadings[ sensor ].data; + if ( OVERRIDE_KEY == currentUncompenstatedConductivityReadings[ sensor ].override ) + { + result = currentUncompenstatedConductivityReadings[ sensor ].ovData; + } + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_CONDUCTIVITY_SENSOR_ID, sensor ) + } + + return result; +} +/*********************************************************************//** + * @brief * The getConductivityTemperatureValue function gets the temperature * value for a given conductivity sensor id. * @details \b Inputs: currentTemperatureReadings[]