Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -rc1ef106ed0f97dc998230c6e154aa2362aa476d8 -r4d7d40a27130dc813d653f044cbb856b1b7d8481 --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision c1ef106ed0f97dc998230c6e154aa2362aa476d8) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 4d7d40a27130dc813d653f044cbb856b1b7d8481) @@ -151,9 +151,8 @@ * @brief * The initHeaters function initializes the variables and the PI controllers * for the primary and trimmer heaters. - * @details - * Inputs : none - * Outputs : Heaters module initialized + * @details Inputs: none + * @details Outputs: Heaters module initialized * @return none *************************************************************************/ void initHeaters( void ) @@ -183,9 +182,8 @@ * @brief * The setPrimaryHeaterTargetTemperature function sets the primary heater * target temperature. - * @details - * Inputs : none - * Outputs : primaryHeaterTargetTemperature + * @details Inputs: none + * @details Outputs: primaryHeaterTargetTemperature * @param targetTemp target temperature for the primary heater * @return none *************************************************************************/ @@ -198,9 +196,8 @@ * @brief * The setTrimmerHeaterTargetTemperature function sets the trimmer heater * target temperature. - * @details - * Inputs : none - * Outputs : trimmerHeaterTargetTemperature + * @details Inputs: none + * @details Outputs: trimmerHeaterTargetTemperature * @param targetTemp target temperature for the trimmer heater * @return none *************************************************************************/ @@ -213,9 +210,8 @@ * @brief * The startPrimaryHeater function starts the primary heaters. It resets * the primary heaters state and sets the main primary heater duty cycle. - * @details - * Inputs : primaryHeaterTargetTemperature - * Outputs : hasStartPrimaryHeaterRequested + * @details Inputs: primaryHeaterTargetTemperature + * @details Outputs: hasStartPrimaryHeaterRequested * @return status *************************************************************************/ BOOL startPrimaryHeater( void ) @@ -237,9 +233,8 @@ * @brief * The startTrimmerHeater function starts the trimmer heater. It resets the * trimmer heater's state and sets the duty cycle of the trimmer heater. - * @details - * Inputs : trimmerHeaterTargetTemperature - * Outputs : hasStartTrimmerHeaterRequested + * @details Inputs: trimmerHeaterTargetTemperature + * @details Outputs: hasStartTrimmerHeaterRequested * @return status *************************************************************************/ BOOL startTrimmerHeater( void ) @@ -260,9 +255,8 @@ /*********************************************************************//** * @brief * The stopPrimaryHeater function stops the primary heater. - * @details - * Inputs : none - * Outputs : Primary heater stops + * @details Inputs: none + * @details Outputs: Primary heater stops * @return none *************************************************************************/ void stopPrimaryHeater( void ) @@ -277,9 +271,8 @@ /*********************************************************************//** * @brief * The stopTrimmerHeater function stops the trimmer heater. - * @details - * Inputs : none - * Outputs : Trimmer heater stops + * @details Inputs: none + * @details Outputs: Trimmer heater stops * @return none *************************************************************************/ void stopTrimmerHeater( void ) @@ -292,9 +285,8 @@ /*********************************************************************//** * @brief * The execHeatersMonitor function turns off the heaters when RO pump is not on. - * @details - * Inputs : none - * Outputs : Turns off the heaters when RO pump is not on + * @details Inputs: none + * @details Outputs: Turns off the heaters when RO pump is not on * @return none *************************************************************************/ void execHeatersMonitor( void ) @@ -314,9 +306,8 @@ /*********************************************************************//** * @brief * The execHeatersSelfTest function executes the heaters' self-test state machine. - * @details - * Inputs : heatersSelfTestState - * Outputs : heatersSelfTestState + * @details Inputs: heatersSelfTestState + * @details Outputs: heatersSelfTestState * @return heatersSelfTestState *************************************************************************/ SELF_TEST_STATUS_T execHeatersSelfTest( void ) @@ -351,9 +342,8 @@ /*********************************************************************//** * @brief * The execPrimaryHeaters function executes the primary heaters' state machine. - * @details - * Inputs : primaryHeatersExecState - * Outputs : primaryHeatersExecState + * @details Inputs: primaryHeatersExecState + * @details Outputs: primaryHeatersExecState * @return none *************************************************************************/ void execPrimaryHeaters( void ) @@ -378,9 +368,8 @@ /*********************************************************************//** * @brief * The execTrimmerHeater function executes the trimmer heater's state machine. - * @details - * Inputs : trimmerHeaterExecState - * Outputs : trimmerHeaterExecState + * @details Inputs: trimmerHeaterExecState + * @details Outputs: trimmerHeaterExecState * @return none *************************************************************************/ void execTrimmerHeater( void ) @@ -406,9 +395,8 @@ * @brief * The handleHeatersSelfTestStart function starts the small primary and * the trimmer heaters for self-test. - * @details - * Inputs : heatersSelfTestResult, selfTestElapsedTime - * Outputs : heatersSelfTestResult, selfTestElapsedTime + * @details Inputs: heatersSelfTestResult, selfTestElapsedTime + * @details Outputs: heatersSelfTestResult, selfTestElapsedTime * @return state (HEATERS_SELF_TEST_STATES_T) *************************************************************************/ static HEATERS_SELF_TEST_STATES_T handleHeatersSelfTestStart( void ) @@ -435,9 +423,8 @@ * elapsed, it checks the thermocouple temperature shared among the two * heaters. If they are in range, it sets the main primary heater and transitions * to the next state. If it fails, it sets an alarm and fails the test. - * @details - * Inputs : heatersSelfTestResult, selfTestElapsedTime - * Outputs : heatersSelfTestResult, selfTestElapsedTime + * @details Inputs: heatersSelfTestResult, selfTestElapsedTime + * @details Outputs: heatersSelfTestResult, selfTestElapsedTime * @return state (HEATERS_SELF_TEST_STATES_T) *************************************************************************/ static HEATERS_SELF_TEST_STATES_T handleHeatersSelfTestSmallPrimaryAndTrimmerHeaters( void ) @@ -475,9 +462,8 @@ * on the main primary heater has elapsed. When the time has elapsed, it * checks to ensure the thermocouple temperature is within the tolerance * of the target temperature. It then transitions to the complete state. - * @details - * Inputs : heatersSelfTestResult - * Outputs : heatersSelfTestResult + * @details Inputs: heatersSelfTestResult + * @details Outputs: heatersSelfTestResult * @return state (HEATERS_SELF_TEST_STATES_T) *************************************************************************/ static HEATERS_SELF_TEST_STATES_T handleHeatersSelfTestMainPrimaryHeater( void ) @@ -511,9 +497,8 @@ * @brief * The handlePrimaryHeaterStateOff function handles the primary heaters at * off state. - * @details - * Inputs : hasStartPrimaryHeaterRequested, isPrimaryHeaterOn - * Outputs : state (PRIMARY_HEATERS_EXEC_STATES_T), isPrimaryHeaterOn + * @details Inputs: hasStartPrimaryHeaterRequested, isPrimaryHeaterOn + * @details Outputs: state (PRIMARY_HEATERS_EXEC_STATES_T), isPrimaryHeaterOn * @return state (PRIMARY_HEATERS_EXEC_STATES_T) *************************************************************************/ static PRIMARY_HEATERS_EXEC_STATES_T handlePrimaryHeaterStateOff( void ) @@ -558,10 +543,9 @@ * @brief * The handlePrimaryHeaterStateControlToTarget function handles the primary * heaters at control state when the heaters are active. - * @details - * Inputs : primaryHeaterTimerCounter, mainPrimaryHeaterDutyCycle, + * @details Inputs: primaryHeaterTimerCounter, mainPrimaryHeaterDutyCycle, * smallPrimaryHeaterDutyCycle, isPrimaryHeaterOn - * Outputs : primaryHeaterTimerCounter, mainPrimaryHeaterDutyCycle, + * @details Outputs: primaryHeaterTimerCounter, mainPrimaryHeaterDutyCycle, * smallPrimaryHeaterDutyCycle * @return state (PRIMARY_HEATERS_EXEC_STATES_T) *************************************************************************/ @@ -625,9 +609,8 @@ * @brief * The handleTrimmerHeaterStateOff function handles the trimmer heater at * off state. - * @details - * Inputs : hasStartTrimmerHeaterRequested, isTrimmerHeaterOn - * Outputs : state (TRIMMER_HEATER_EXEC_STATES_T), isTrimmerHeaterOn + * @details Inputs: hasStartTrimmerHeaterRequested, isTrimmerHeaterOn + * @details Outputs: state (TRIMMER_HEATER_EXEC_STATES_T), isTrimmerHeaterOn * @return state (TRIMMER_HEATER_EXEC_STATES_T) *************************************************************************/ static TRIMMER_HEATER_EXEC_STATES_T handleTrimmerHeaterStateOff( void ) @@ -638,10 +621,10 @@ #ifdef DEBUG_ENABLED #ifdef ENABLE_DIP_SWITCHES #ifndef EMC_TEST_BUILD - if ( TOGGLEPRIMAYHEATER() ) - { - setTrimmerHeaterTargetTemperature( 38 ); - startTrimmerHeater(); +// if ( TOGGLEPRIMAYHEATER() ) +// { + //setTrimmerHeaterTargetTemperature( 38 ); + //startTrimmerHeater(); //F32 pumpPWM = 1; //etpwmSetCmpB( etpwmREG2, (U32)( (S32)( ( pumpPWM * (F32)(etpwmREG2->TBPRD) ) + FLOAT_TO_INT_ROUNDUP_OFFSET ) ) ); //temporaryStartROPump(); @@ -651,7 +634,7 @@ //etpwmSetCmpB( etpwmREG6, (U32)( (S32)( ( fanPWM * (F32)(etpwmREG6->TBPRD) ) + FLOAT_TO_INT_ROUNDUP_OFFSET ) ) ); //temporaryStartROPump(); //temporaryStartFan(); - } +// } #endif #endif #endif @@ -675,9 +658,8 @@ * @brief * The handleTrimmerHeaterControlToTarget function handles the trimmer * heater at control state when the heater is active. - * @details - * Inputs : trimmerHeaterTimerCounter, trimmerHeaterDutyCycle - * Outputs : trimmerHeaterTimerCounter, trimmerHeaterDutyCycle, isTrimmerHeaterOn + * @details Inputs: trimmerHeaterTimerCounter, trimmerHeaterDutyCycle + * @details Outputs: trimmerHeaterTimerCounter, trimmerHeaterDutyCycle, isTrimmerHeaterOn * @return state (TRIMMER_HEATER_EXEC_STATES_T) *************************************************************************/ static TRIMMER_HEATER_EXEC_STATES_T handleTrimmerHeaterControlToTarget( void ) @@ -698,9 +680,9 @@ #ifdef DEBUG_ENABLED #ifdef ENABLE_DIP_SWITCHES #ifndef EMC_TEST_BUILD - if ( !TOGGLEPRIMAYHEATER() ) - { - stopTrimmerHeater(); +// if ( !TOGGLEPRIMAYHEATER() ) +// { + //stopTrimmerHeater(); //F32 pumpPWM = 0; //etpwmSetCmpB( etpwmREG2, (U32)( (S32)( ( pumpPWM * (F32)(etpwmREG2->TBPRD) ) + FLOAT_TO_INT_ROUNDUP_OFFSET ) ) ); //temporaryStartROPump(); @@ -710,7 +692,7 @@ //etpwmSetCmpB( etpwmREG6, (U32)( (S32)( ( fanPWM * (F32)(etpwmREG6->TBPRD) ) + FLOAT_TO_INT_ROUNDUP_OFFSET ) ) ); //temporaryStopROPump(); //temporaryStopFan(); - } +// } #endif #endif #endif @@ -727,9 +709,8 @@ /*********************************************************************//** * @brief * The setMainPrimaryHeaterPWM function sets the PWM of the main primary heater. - * @details - * Inputs : none - * Outputs : Sets the PWM duty cycle for the main primary heater + * @details Inputs: none + * @details Outputs: Sets the PWM duty cycle for the main primary heater * @param pwm PWM duty cycle to set for 1st primary heater element * @return none *************************************************************************/ @@ -741,9 +722,8 @@ /*********************************************************************//** * @brief * The setSmallPrimaryHeaterPWM function sets the PWM of the small primary heater. - * @details - * Inputs : none - * Outputs : Sets the PWM duty cycle for the small primary heater + * @details Inputs: none + * @details Outputs: Sets the PWM duty cycle for the small primary heater * @param pwm PWM duty cycle to set for 2nd primary heater element * @return none *************************************************************************/ @@ -755,9 +735,8 @@ /*********************************************************************//** * @brief * The setTrimmerHeaterPWM function sets the PWM of the trimmer heater. - * @details - * Inputs : none - * Outputs : Sets the PWM duty cycle for the trimmer heater + * @details Inputs: none + * @details Outputs: Sets the PWM duty cycle for the trimmer heater * @param pwm PWM duty cycle to set for trimmer heater * @return none *************************************************************************/ @@ -769,9 +748,8 @@ /*********************************************************************//** * @brief * The resetHeaterState function resets the PI controller of the selected heater. - * @details - * Inputs : mainPrimaryHeaterDutyCycle, trimmerHeaterDutyCycle - * Outputs : mainPrimaryHeaterDutyCycle, trimmerHeaterDutyCycle + * @details Inputs: mainPrimaryHeaterDutyCycle, trimmerHeaterDutyCycle + * @details Outputs: mainPrimaryHeaterDutyCycle, trimmerHeaterDutyCycle * @param heater enumeration of the heater for which the PI controller will be reset * @return none *************************************************************************/ @@ -792,9 +770,8 @@ /*********************************************************************//** * @brief * The getPublishHeatersDataInterval function gets the publish interval. - * @details - * Inputs : heatersDataPublishInterval - * Outputs : none + * @details Inputs: heatersDataPublishInterval + * @details Outputs: none * @return result *************************************************************************/ U32 getPublishHeatersDataInterval( void ) @@ -813,9 +790,8 @@ * @brief * The publishTemperatureData function publishes the temperature sensors * data into the USB debug port at the defined time interval. - * @details - * Inputs : dataPublicationTimerCounter - * Outputs : Broadcast temperature sensors' data + * @details Inputs: dataPublicationTimerCounter + * @details Outputs: Broadcast temperature sensors' data * @return none *************************************************************************/ static void publishHeatersData( void ) @@ -856,9 +832,8 @@ * @brief * The testSetHeatersPublishIntervalOverride function overrides the heaters * publish data time interval. - * @details - * Inputs : heatersDataPublishInterval - * Outputs : heatersDataPublishInterval + * @details Inputs: heatersDataPublishInterval + * @details Outputs: heatersDataPublishInterval * @return result *************************************************************************/ BOOL testSetHeatersPublishIntervalOverride( U32 value ) @@ -881,9 +856,8 @@ * @brief * The testResetHeatersPublishIntervalOverride function resets the heaters * publish time interval to its previous time interval. - * @details - * Inputs : heatersDataPublishInterval - * Outputs : heatersDataPublishInterval + * @details Inputs: heatersDataPublishInterval + * @details Outputs: heatersDataPublishInterval * @return result *************************************************************************/ BOOL testResetHeatersPublishIntervalOverride( void )