Index: firmware/App/Services/Interrupts.c =================================================================== diff -u -rdd70052b03eeb284223a4aade8567a4acec63efb -ree52cb8a255151dca7716a651a933eb5603902ef --- firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision dd70052b03eeb284223a4aade8567a4acec63efb) +++ firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision ee52cb8a255151dca7716a651a933eb5603902ef) @@ -16,6 +16,7 @@ ***************************************************************************/ #include "can.h" +#include "rti.h" #include "sci.h" #include "sys_dma.h" @@ -24,6 +25,9 @@ #include "Interrupts.h" #include "FPGA.h" #include "SystemComm.h" +#include "TaskGeneral.h" +#include "TaskPriority.h" +#include "TaskTimer.h" #include "Utilities.h" #ifdef DEBUG_ENABLED #include "SystemCommMessages.h" @@ -95,6 +99,41 @@ #endif } +/*********************************************************************//** + * @brief + * The rtiNotification function handles real-time interrupt notifications. + * @details + * Inputs : none + * Outputs : RTI notification handled. + * @param notification : Which RTI timer caused this interrupt. + * @return none + *************************************************************************/ +void rtiNotification(uint32 notification) +{ + switch ( notification ) + { + case rtiNOTIFICATION_COMPARE0: + taskTimer(); + break; + + case rtiNOTIFICATION_COMPARE1: + taskPriority(); + break; + + case rtiNOTIFICATION_COMPARE2: + // do nothing - unused at this time + break; + + case rtiNOTIFICATION_COMPARE3: + taskGeneral(); + break; + + default: + // TODO - s/w fault? + break; + } +} + /*********************************************************************//** * @brief * The canMessageNotification function handles CAN message notifications. @@ -129,9 +168,9 @@ void canErrorNotification(canBASE_t *node, uint32 notification) { #ifdef DEBUG_ENABLED - // TODO - temporary debug code - remove later char debugStr[ 256 ]; -#endif +#endif + if ( node == canREG1 ) { if ( notification & canLEVEL_PARITY_ERR ) @@ -184,7 +223,7 @@ } else { - // ignore - other bits undefined + // ignore - other notifications undefined } } } @@ -217,7 +256,6 @@ { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_FPGA_UART_FRAME_ERROR ) } - // TODO - try to do something to recover (+ max retries = comm fault) #ifdef DEBUG_ENABLED sprintf( debugStr, "FPGA UART FR err:%5d \n", sci2FrameErrorCnt ); sendDebugData( (U08*)debugStr, strlen(debugStr) ); @@ -232,7 +270,6 @@ { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_FPGA_UART_OVERRUN_ERROR ) } - // TODO - try to do something to recover (+ max retries = comm fault) #ifdef DEBUG_ENABLED sprintf( debugStr, "FPGA UART OR err:%5d \n", sci2OverrunErrorCnt ); sendDebugData( (U08*)debugStr, strlen(debugStr) ); @@ -247,7 +284,6 @@ { sci1FrameErrorCnt++; clearSCI1CommErrors(); - // TODO - try to do something to recover (+ max retries = comm fault) sprintf( debugStr, "Debug UART FR err:%5d \n", sci1FrameErrorCnt ); sendDebugData( (U08*)debugStr, strlen(debugStr) ); sendDebugDataToUI( (U08*)debugStr ); @@ -256,7 +292,6 @@ { sci1OverrunErrorCnt++; clearSCI1CommErrors(); - // TODO - try to do something to recover (+ max retries = comm fault) sprintf( debugStr, "Debug UART OR err:%5d \n", sci1OverrunErrorCnt ); sendDebugData( (U08*)debugStr, strlen(debugStr) ); sendDebugDataToUI( (U08*)debugStr ); Index: firmware/source/rti.c =================================================================== diff -u -rf068446fdb7889d320ddb6ffbd58f347ce0501e7 -ree52cb8a255151dca7716a651a933eb5603902ef --- firmware/source/rti.c (.../rti.c) (revision f068446fdb7889d320ddb6ffbd58f347ce0501e7) +++ firmware/source/rti.c (.../rti.c) (revision ee52cb8a255151dca7716a651a933eb5603902ef) @@ -865,7 +865,6 @@ void rtiCompare0Interrupt(void) { /* USER CODE BEGIN (74) */ - taskTimer(); /* USER CODE END */ rtiREG1->INTFLAG = 1U; @@ -891,7 +890,6 @@ void rtiCompare1Interrupt(void) { /* USER CODE BEGIN (77) */ - taskPriority(); /* USER CODE END */ rtiREG1->INTFLAG = 2U; @@ -919,7 +917,6 @@ void rtiCompare3Interrupt(void) { /* USER CODE BEGIN (83) */ - taskGeneral(); /* USER CODE END */ rtiREG1->INTFLAG = 8U;