Index: firmware/App/Controllers/TemperatureSensors.c =================================================================== diff -u -r986abcfcf047822cad1a10c1ee0924a80dd5f512 -re7dd4d4f0d9cbb0d8e7abb994a16f0389251e4ba --- firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision 986abcfcf047822cad1a10c1ee0924a80dd5f512) +++ firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision e7dd4d4f0d9cbb0d8e7abb994a16f0389251e4ba) @@ -166,7 +166,7 @@ static BOOL isADCReadValid( U32 sensorIndex, U32 fpgaError, U32 fpgaCount ); static void processADCRead( U32 sensorIndex, S32 adc ); static void publishTemperatureSensorsData( void ); -static void monitorTemperatureSnsrs( U32 sensorIndex ); +static void monitorTemperatureSnsrs( U32 sensorIndex, F32 temperature ); /*********************************************************************//** * @brief @@ -382,7 +382,7 @@ if ( sensorIndex < NUM_OF_TEMPERATURE_SENSORS ) { - if ( OVERRIDE_KEY == tempSensors[ sensorIndex ].temperatureValues.override ) + if ( tempSensors[ sensorIndex ].temperatureValues.override == OVERRIDE_KEY ) { temperature = tempSensors[ sensorIndex ].temperatureValues.ovData; } @@ -722,7 +722,7 @@ tempSensors[ sensorIndex ].temperatureValues.data = temperature; // Monitor the temperature value - monitorTemperatureSnsrs( sensorIndex ); + monitorTemperatureSnsrs( sensorIndex, temperature ); } /*********************************************************************//** @@ -889,14 +889,17 @@ * @details Inputs: tempSensors * @details Outputs: tempSensors * @param sensorIndex the index of the temperature sensor + * @param temperature the temperature value to be checked * @return none *************************************************************************/ -static void monitorTemperatureSnsrs( U32 sensorIndex ) +static void monitorTemperatureSnsrs( U32 sensorIndex, F32 temperature ) { - F32 temperature = getTemperatureValue( sensorIndex ); + // The maximum allowed temperature is different for the sensors that are in the fluid path + // with the ones that are not in the fluid path + F32 maxLimit = tempSensors[ sensorIndex ].maxAllowedTemperature; // Check both temperature and to be in range - if ( ( temperature < TEMP_SENSORS_MIN_ALLOWED_DEGREE_C ) || ( temperature > tempSensors[ sensorIndex ].maxAllowedTemperature ) ) + if ( ( temperature < TEMP_SENSORS_MIN_ALLOWED_DEGREE_C ) || ( temperature > maxLimit ) ) { // TODO investigate //checkPersistentAlarm( ALARM_ID_DG_TEMPERATURE_SENSOR_OUT_OF_RANGE, TRUE, sensorIndex, temperature ); @@ -925,7 +928,7 @@ if ( sensorIndex < NUM_OF_TEMPERATURE_SENSORS ) { - if ( TRUE == isTestingActivated() ) + if ( isTestingActivated() ) { result = TRUE; tempSensors[ sensorIndex ].temperatureValues.ovData = temperature; @@ -951,7 +954,7 @@ if ( sensorIndex < NUM_OF_TEMPERATURE_SENSORS ) { - if ( TRUE == isTestingActivated() ) + if ( isTestingActivated() ) { result = TRUE; tempSensors[ sensorIndex ].temperatureValues.override = OVERRIDE_RESET; @@ -975,7 +978,7 @@ { BOOL result = FALSE; - if ( TRUE == isTestingActivated() ) + if ( isTestingActivated() ) { U32 interval = value / TASK_PRIORITY_INTERVAL; @@ -999,7 +1002,7 @@ { BOOL result = FALSE; - if ( TRUE == isTestingActivated() ) + if ( isTestingActivated() ) { result = TRUE; tempSensorsPublishInterval.override = OVERRIDE_RESET;