Index: firmware/App/Controllers/TemperatureSensors.c =================================================================== diff -u -r6514feba9790e6aacd772ebc254c8bf8044cdde2 -r5c2fecbf85350564ac155141f38781514f27a155 --- firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision 6514feba9790e6aacd772ebc254c8bf8044cdde2) +++ firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision 5c2fecbf85350564ac155141f38781514f27a155) @@ -170,9 +170,7 @@ * The initTemperatureSensors function initializes the module * @details * Inputs : none - * Outputs : tempSensorsSelfTestResult, tempSensorsSelfTestState, - * tempSensorsExecState, sampleCount, elapsedTime, tempSensors - * @param none + * Outputs : TemperatureSensors module initialized * @return none *************************************************************************/ void initTemperatureSensors ( void ) @@ -245,7 +243,6 @@ * @details * Inputs : tempSensorsSelfTestState * Outputs : tempSensorsSelfTestState - * @param none * @return tempSensorsSelfTestState *************************************************************************/ SELF_TEST_STATUS_T execTemperatureSensorsSelfTest ( void ) @@ -285,7 +282,6 @@ * @details * Inputs : tempSensorsExecState * Outputs : tempSensorsExecState - * @param none * @return none *************************************************************************/ void execTemperatureSensors ( void ) @@ -315,7 +311,7 @@ * The checkInletWaterTemperature checks inlet water temperature value * and triggers an alarm when temperature value is out of allowed range. * @details - * Inputs : none + * Inputs : Inlet water temperature value * Outputs : Trigger alarms when temperature is out of allowed range * @param none * @return none @@ -361,7 +357,7 @@ * @details * Inputs : none * Outputs : none - * @param sensor + * @param sensor : Temperature sensor enum * @return temperature *************************************************************************/ F32 getTemperatureValue ( U32 sensor ) @@ -388,8 +384,12 @@ * ADC read from FPGA * @details * Inputs : none - * Outputs : temperatureValues - * @param avgADC, gain, refResistance, zeroDegResistance + * Outputs : none + * @param avgADC : Running average ADC + * @param gain : ADC gain + * @param refResistance : ADC reference resistance + * @param zeroDegResistance : ADC zero degree resistance + * #param adcConversionCoeff : ADC conversion coefficient * @return temperature *************************************************************************/ static F32 getADC2TempConversion ( F32 avgADC, U32 gain, U32 refResistance, U32 zeroDegResistance, F32 adcConversionCoeff ) @@ -419,7 +419,8 @@ * @details * Inputs : temperatureValues * Outputs : temperatureValues - * @param TCIndex, CJIndex + * @param TCIndex : Heater thermo couple index + * @param CJIndex : Heater cold junction index * @return none *************************************************************************/ static void getHeaterInternalTemp ( U32 TCIndex, U32 CJIndex ) @@ -476,7 +477,10 @@ * @details * Inputs : none * Outputs : none - * @param sensorIndex, adc, fpgaError, fpgaCount + * @param sensorIndex : Temperature sensor index + * @param adc : ADC reading from FPGA + * @param fpgaError : FPGA error count + * @param fpgaCount : FPGA read count * @return none *************************************************************************/ static void processTempSnsrsADCRead ( U32 sensorIndex, U32 adc, U32 fpgaError, U32 fpgaCount ) @@ -499,7 +503,10 @@ * @details * Inputs : none * Outputs : none - * @param sensorIndex, adc, fpgaError, fpgaCount + * @param sensorIndex : Temperature sensor index + * @param adc : ADC reading from FPGA + * @param fpgaError : FPGA error count + * @param fpgaCount : FPGA read count * @return none *************************************************************************/ static void processHtrsTempSnsrsADCRead ( U32 sensorIndex, U32 adc, U32 fpgaError, U32 fpgaCount ) @@ -535,13 +542,15 @@ /************************************************************************* * @brief * The isADCReadValid function checks if there is an FPGA error and FPGA - * count. If there is any error in the FPGA error, it raises and alarm. - * If the count has changed and the ADC value is not the same as the previous - * ADC read, it returns a TRUE, signaling that the ADC is valid to be processed + * count. If there is any FPGA, it raises an alarm. If the count has changed + * and the ADC value is not the same as the previous ADC read, it returns a + * TRUE, signaling that the ADC is valid to be processed. * @details - * Inputs : readAndErrorCounts - * Outputs : readAndErrorCounts - * @param sensorIndex, fpgaError, fpgaCount + * Inputs : readCount + * Outputs : readCount, internalErrorCount + * @param sensorIndex : Temperature sensor index + * @param fpgaError : FPGA error count + * @param fpgaCount : FPGA read count * @return isADCValid (BOOL) *************************************************************************/ static BOOL isADCReadValid ( U32 sensorIndex, U32 fpgaError, U32 fpgaCount ) @@ -581,9 +590,10 @@ * index and calculates the running sum and the moving average of the ADCs * The temperatureSensorsADCRead and tempSensorsAvgADCValues are updated * @details - * Inputs : runningSumAndIndex, rawADCReads, sampleCount, temperatureValues - * Outputs : runningSumAndIndex, rawADCReads, sampleCount, temperatureValues - * @param sensorIndex, adc + * Inputs : adcNextIndex, rawADCReads, adcRunningSum + * Outputs : adcNextIndex, rawADCReads, adcRunningSum, temperatureValues + * @param sensorIndex : Temperature sensor index + * @param adc : adc reading from fpga * @return none *************************************************************************/ static void processADCRead ( U32 sensorIndex, S32 adc ) @@ -632,7 +642,7 @@ * Inputs : none * Outputs : none * @param none - * @return state (TEMPSENSORS_SELF_TEST_STATES_T) + * @return TEMPSENSORS_SELF_TEST_CONSISTENCY_CHECK (TEMPSENSORS_SELF_TEST_STATES_T) *************************************************************************/ static TEMPSENSORS_SELF_TEST_STATES_T handleSelfTestADCCheck ( void ) { @@ -657,7 +667,7 @@ * Inputs : none * Outputs : none * @param none - * @return state (TEMPSENSORS_SELF_TEST_STATES_T) + * @return TEMPSENSORS_SELF_TEST_COMPLETE (TEMPSENSORS_SELF_TEST_STATES_T) *************************************************************************/ static TEMPSENSORS_SELF_TEST_STATES_T handleSelfTestConsistencyCheck ( void ) { @@ -676,10 +686,13 @@ tempSensors[ TEMPSENSORS_OUTLET_PRIMARY_HEATER ].conversionCoef ); F32 const tempDiff = fabs(tpiTemperature - tpoTemperature); - if ( tempDiff > MAX_ALLOWED_TEMP_DELTA_BETWEEN_SENSORS ) { + if ( tempDiff > MAX_ALLOWED_TEMP_DELTA_BETWEEN_SENSORS ) + { tempSensorsSelfTestResult = SELF_TEST_STATUS_FAILED; SET_ALARM_WITH_1_U32_DATA ( ALARM_ID_TEMPERATURE_SENSORS_INCONSISTENT, TEMPSENSORS_SELF_TEST_CONSISTENCY_CHECK ); - } else { + } + else + { tempSensorsSelfTestResult = SELF_TEST_STATUS_PASSED; }