Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -rd3819286869611f9c02add72a0f8e321598fdf42 -rde2ef5ff6293f23a43414c5e2e40630468a68ddf --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision de2ef5ff6293f23a43414c5e2e40630468a68ddf) @@ -511,22 +511,12 @@ // If the flow is within range, run the PI controller to control the heaters normally if ( FALSE == isFlowBelowMin ) { - // If the primary heater is running and another start primary heater request - // is set, reset the primary heater again - if ( TRUE == hasStartPrimaryHeaterRequested ) - { - resetHeaterState( PRIMARY_HEATER ); - hasStartPrimaryHeaterRequested = FALSE; - } - else - { - F32 outletTemp = getTemperatureValue( primaryHeatersFeedbackTempSensor ); - mainPrimaryHeaterDutyCycle = runPIController( PI_CONTROLLER_ID_PRIMARY_HEATER, primaryHeaterTargetTemperature, outletTemp ); + F32 outletTemp = getTemperatureValue( primaryHeatersFeedbackTempSensor ); + mainPrimaryHeaterDutyCycle = runPIController( PI_CONTROLLER_ID_PRIMARY_HEATER, primaryHeaterTargetTemperature, outletTemp ); - // Once the primary heaters duty cycle is set, it is divided into 2 so both heaters will start and both elements are heated up - smallPrimaryHeaterDutyCycle = mainPrimaryHeaterDutyCycle / MAIN_AND_SMALL_PRIMARY_HEATER_DUTY_CYCLE_DIVISOR; - mainPrimaryHeaterDutyCycle = mainPrimaryHeaterDutyCycle / MAIN_AND_SMALL_PRIMARY_HEATER_DUTY_CYCLE_DIVISOR; - } + // Once the primary heaters duty cycle is set, it is divided into 2 so both heaters will start and both elements are heated up + smallPrimaryHeaterDutyCycle = mainPrimaryHeaterDutyCycle / MAIN_AND_SMALL_PRIMARY_HEATER_DUTY_CYCLE_DIVISOR; + mainPrimaryHeaterDutyCycle = mainPrimaryHeaterDutyCycle / MAIN_AND_SMALL_PRIMARY_HEATER_DUTY_CYCLE_DIVISOR; setMainPrimaryHeaterPWM( mainPrimaryHeaterDutyCycle ); setSmallPrimaryHeaterPWM( smallPrimaryHeaterDutyCycle ); @@ -541,6 +531,14 @@ primaryHeaterTimerCounter = 0; } + // If the primary heater is running and another start primary heater request + // is set, reset the primary heater again + if ( TRUE == hasStartPrimaryHeaterRequested ) + { + resetHeaterState( PRIMARY_HEATER ); + hasStartPrimaryHeaterRequested = FALSE; + } + if ( FALSE == isPrimaryHeaterOn ) { // Switch to off state. Set the duty cycles to 0 @@ -610,6 +608,11 @@ trimmerHeaterTimerCounter = 0; } + if ( TRUE == hasStartTrimmerHeaterRequested ) + { + hasStartTrimmerHeaterRequested = FALSE; + } + if ( FALSE == isTrimmerHeaterOn ) { // Set the duty cycle to 0 and switch to off state Index: firmware/App/Services/Interrupts.c =================================================================== diff -u -r9b468e9886795094503fd62e6b47829876d740a3 -rde2ef5ff6293f23a43414c5e2e40630468a68ddf --- firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 9b468e9886795094503fd62e6b47829876d740a3) +++ firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision de2ef5ff6293f23a43414c5e2e40630468a68ddf) @@ -45,9 +45,6 @@ // ********** private data ********** -static U32 sci2FrameErrorCnt; ///< SCI2 frame error count. -static U32 sci2OverrunErrorCnt; ///< SCI2 overrun error count. - static U32 can1WarningCnt; ///< CAN1 warning count. static U32 can1BusOffCnt; ///< CAN1 bus offline count. static U32 can1ParityCnt; ///< CAN1 parity count. @@ -61,8 +58,6 @@ *************************************************************************/ void initInterrupts( void ) { - sci2FrameErrorCnt = 0; - sci2OverrunErrorCnt = 0; can1WarningCnt = 0; can1BusOffCnt = 0; can1ParityCnt = 0; @@ -182,51 +177,16 @@ else if ( notification & canLEVEL_WARNING ) { can1WarningCnt++; + } + else + { + // Ignore - other notifications - unhandled } - else - { - // ignore - other notifications undefined - } } } /*********************************************************************//** * @brief - * The sciNotification function handles UART communication error interrupts. - * Frame and Over-run errors are handled. - * @details Inputs: none - * @details Outputs: UART error interrupts handled. - * @param sci pointer to the SCI peripheral that detected the error - * @param flags error flag(s) - * @return none - *************************************************************************/ -void sciNotification(sciBASE_t *sci, uint32 flags) -{ - if ( sci == scilinREG ) - { - if ( ( flags & SCI_FE_INT ) != 0 ) - { - sci2FrameErrorCnt++; - clearSCI2CommErrors(); - if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_UART_FRAME_ERROR ) ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_FPGA_UART_FRAME_ERROR ) - } - } - if ( ( flags & SCI_OE_INT ) != 0 ) - { - sci2OverrunErrorCnt++; - clearSCI2CommErrors(); - if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_UART_OVERRUN ) ) - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_FPGA_UART_OVERRUN_ERROR ) - } - } - } -} - -/*********************************************************************//** - * @brief * The dmaGroupANotification function handles communication DMA interrupts. * @details Inputs: none * @details Outputs: DMA interrupt is handled.