Index: firmware/App/Drivers/TemperatureSensors.c =================================================================== diff -u -r3417933e6edf61a914c428e2fa944b3b349272a4 -rae7a7f0dc06fd31a53b0db564d515ce4c39acf67 --- firmware/App/Drivers/TemperatureSensors.c (.../TemperatureSensors.c) (revision 3417933e6edf61a914c428e2fa944b3b349272a4) +++ firmware/App/Drivers/TemperatureSensors.c (.../TemperatureSensors.c) (revision ae7a7f0dc06fd31a53b0db564d515ce4c39acf67) @@ -34,6 +34,8 @@ // ********** private definitions ********** +#define USE_PT_100 1 ///< flag to check PT100 use in calculations + #define PRIMARY_HEATER_TEMP_SENSORS_GAIN 8U ///< Primary heater temperature sensors gain. #define PRIMARY_HEATER_TEMP_SENSORS_REF_RESISTANCE 20000 ///< Primary heater temperature sensors reference resistance. #define PRIMARY_HEATER_TEMP_SENSORS_0_DEGREE_RESISTANCE 1000U ///< Primary heater temperature sensors zero degree resistance. @@ -132,6 +134,12 @@ tempSensors[ D50_TEMP ].zeroDegreeResistance = PRIMARY_HEATER_TEMP_SENSORS_0_DEGREE_RESISTANCE; tempSensors[ D50_TEMP ].maxAllowedTemp = TEMP_SENSORS_MAX_ALLOWED_DEGREE_C; + tempSensors[ D99_TEMP ].gain = PRIMARY_HEATER_TEMP_SENSORS_GAIN; + tempSensors[ D99_TEMP ].refResistance = PRIMARY_HEATER_TEMP_SENSORS_REF_RESISTANCE; + tempSensors[ D99_TEMP ].zeroDegreeResistance = PRIMARY_HEATER_TEMP_SENSORS_0_DEGREE_RESISTANCE; + tempSensors[ D99_TEMP ].maxAllowedTemp = TEMP_SENSORS_MAX_ALLOWED_DEGREE_C; + + // Board temperature sensors conversion coefficient tempSensors[ BRD_TEMP ].conversionCoeff = conversionCoeff; tempSensors[ BRD_TEMP ].maxAllowedTemp = NON_FLUID_PATH_TEMP_SENSORS_MAX_ALLOWED_DEGREE_C; @@ -189,6 +197,7 @@ processTempSnsrsADCRead( D78_TEMP, getFPGAD78Temp() ); processTempSnsrsADCRead( D4_TEMP, getFPGAD4Temp() ); processTempSnsrsADCRead( D50_TEMP, getFPGAD50Temp() ); + processTempSnsrsADCRead( D99_TEMP, getFPGAD99Temp() ); //TODO: Read Board temperature //processTempSnsrsADCRead( TEMPSENSORS_INTERNAL_COND_TEMP_SENSOR, getFPGACondSnsrInternalTemp() ); @@ -314,6 +323,7 @@ case D78_TEMP: case D4_TEMP: case D50_TEMP: + case D99_TEMP: temperature = getADC2TempConversion( avgADCReads, (U32)tempSensors [ sensorIndex ].gain, (U32)tempSensors [ sensorIndex ].refResistance, (U32)tempSensors [ sensorIndex ].zeroDegreeResistance, tempSensors [ sensorIndex ].conversionCoeff ); break; @@ -408,6 +418,10 @@ //calId = CAL_DATA_TRIM_HEATER_TEMP; break; + case D99_TEMP: + //calId = CAL_DATA_DIALYSATE_TEMP; + break; + default: // Set the calibration temperature value as num of meaning calibration is not needed for the provided sensor //calId = NUM_OF_CAL_DATA_TEMP_SENSORS;