Index: firmware/App/Controllers/TemperatureSensors.c =================================================================== diff -u -rae823785919192402707da5083e9b0ad40bd4938 -ra4669c80291e85fa5ce17d77ebcfd0c882831202 --- firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision ae823785919192402707da5083e9b0ad40bd4938) +++ firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision a4669c80291e85fa5ce17d77ebcfd0c882831202) @@ -8,7 +8,7 @@ * @file TemperatureSensors.c * * @author (last) Dara Navaei -* @date (last) 25-May-2022 +* @date (last) 04-Aug-2022 * * @author (original) Dara Navaei * @date (original) 08-Apr-2020 @@ -194,8 +194,8 @@ static void processADCRead( U32 sensorIndex, S32 adc ); static void publishTemperatureSensorsData( void ); static void monitorTemperatureSenors( void ); -static void adjustTemperatureSensorsV3DVTRefResistance( void ); static void checkBaroSensorCRC( void ); +static void adjustTemperatureSensorsRefResistance( void ); /*********************************************************************//** * @brief @@ -374,7 +374,7 @@ void execTemperatureSensors( void ) { // Check the status of the software configuration - adjustTemperatureSensorsV3DVTRefResistance(); + adjustTemperatureSensorsRefResistance(); // Read the sensors all the time switch ( tempSensorsExecState ) @@ -459,6 +459,8 @@ if ( sensorIndex < NUM_OF_TEMPERATURE_SENSORS ) { temperature = getF32OverrideValue( &tempSensors[ sensorIndex ].temperatureValues ); + +#ifndef _RELEASE_ // If the system is V3 and THd or its ADC internal temperature is requested, return TRo instead. V3 does not have // the electrical connection of THd sensor. if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_V3_SYSTEM ) ) @@ -468,6 +470,7 @@ temperature = getF32OverrideValue( &tempSensors[ TEMPSENSORS_OUTLET_REDUNDANT ].temperatureValues ); } } +#endif } else { @@ -637,6 +640,7 @@ case TEMPSENSORS_INTERNAL_THD_RTD: { U08 i; + // Shift bits by 31 to right to check the error bit status tempSensors[ sensorIndex ].sensorErrorBitStatus = adc >> SHIFT_BITS_BY_31; @@ -766,6 +770,7 @@ BOOL isADCNotValid = FALSE; U32 index = tempSensors[ sensorIndex ].adcNextIndex; S32 indexValue = tempSensors[ sensorIndex ].rawADCReads [ index ]; + // Update the temperature sensors' structure tempSensors[ sensorIndex ].rawADCReads[ index ] = adc; tempSensors[ sensorIndex ].adcNextIndex = INC_WRAP( index, 0, MAX_NUM_OF_RAW_ADC_SAMPLES - 1 ); @@ -969,6 +974,7 @@ if ( ++dataPublicationTimerCounter >= getU32OverrideValue( &tempSensorsPublishInterval ) ) { TEMPERATURE_SENSORS_DATA_T data; + data.inletPrimaryHeater = getTemperatureValue( TEMPSENSORS_INLET_PRIMARY_HEATER ); data.heatDisinfect = getTemperatureValue( TEMPSENSORS_HEAT_DISINFECT ); data.outletPrimaryHeater = getTemperatureValue( TEMPSENSORS_OUTLET_PRIMARY_HEATER ); @@ -1037,22 +1043,27 @@ /*********************************************************************//** * @brief - * The adjustTemperatureSensorsV3DVTRefResistance function adjusts the temperature + * The adjustTemperatureSensorsRefResistance function adjusts the temperature * sensors V3 or DVT reference resistance values. * @details Inputs: tempSensors * @details Outputs: tempSensors * @return none *************************************************************************/ -static void adjustTemperatureSensorsV3DVTRefResistance( void ) +static void adjustTemperatureSensorsRefResistance( void ) { // The defaults are DVT values U32 primaryAndCondSensorsRefResistance = PRIMARY_HEATER_EXT_TEMP_SENSORS_REF_RESISTANCE; U32 externalTempSesnorsRefResitance = TRIMMER_HEATER_EXT_TEMP_SENSORS_REF_RESISTANCE; - if ( ( getCurrentOperationMode() != DG_MODE_INIT ) && ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_V3_SYSTEM ) ) ) +#ifndef _RELEASE_ + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_V3_SYSTEM ) ) +#endif { - primaryAndCondSensorsRefResistance = PRIMARY_HEATER_EXT_TEMP_SENSORS_V3_REF_RESISTANCE; - externalTempSesnorsRefResitance = TRIMMER_HEATER_EXT_TEMP_SENSORS_V3_REF_RESISTANCE; + if ( getCurrentOperationMode() != DG_MODE_INIT ) + { + primaryAndCondSensorsRefResistance = PRIMARY_HEATER_EXT_TEMP_SENSORS_V3_REF_RESISTANCE; + externalTempSesnorsRefResitance = TRIMMER_HEATER_EXT_TEMP_SENSORS_V3_REF_RESISTANCE; + } } tempSensors[ TEMPSENSORS_INLET_PRIMARY_HEATER ].refResistance = primaryAndCondSensorsRefResistance;