Index: firmware/App/Services/Interrupts.c =================================================================== diff -u -r012573b1913d1bfd2357acfadcad6bb20b295ad9 -rc74c1d99a011dd0fb7f98f183faecda675221fce --- firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 012573b1913d1bfd2357acfadcad6bb20b295ad9) +++ firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision c74c1d99a011dd0fb7f98f183faecda675221fce) @@ -1,9 +1,3 @@ -/* - * Interrupts.c - * - * Created on: Aug 1, 2024 - * Author: fw - */ #include "can.h" #include "rti.h" @@ -18,14 +12,41 @@ #include "TaskPriority.h" #include "TaskTimer.h" +/** + * @addtogroup Interrupts + * @{ + */ + +// ********** private definitions ********** + +// TODO do we need more error handling? (i.e. canErrorNotification) + +// ********** private data ********** + static BOOL sci2FEOEError; ///< FPGA serial frame or overrun flag; +// ********** private function prototypes ********** +/*********************************************************************//** + * @brief + * The initInterrupts function initializes the Interrupts unit. + * @details \b Inputs: none + * @details \b Outputs: Interrupts unit initialized. + * @return none + *************************************************************************/ void initInterrupts( void ) { sci2FEOEError = FALSE; } +/*********************************************************************//** + * @brief + * The getSci2FEOEError function returns the sci2FEOEError (OE - Overrun, + * FE - Framing Error) status and resets the status if TRUE + * @details \b Inputs: sci2FEOEError + * @details \b Outputs: none + * @return sci2 FE / OE error + *************************************************************************/ BOOL getSci2FEOEError( void ) { BOOL returnValue = sci2FEOEError; @@ -35,6 +56,14 @@ return returnValue; } +/*********************************************************************//** + * @brief + * The rtiNotification function handles real-time interrupt notifications. + * @details \b Inputs: none + * @details \b Outputs: Task associated with given notification is executed. + * @param notification ID of RTI timer that caused this interrupt + * @return none + *************************************************************************/ void rtiNotification( uint32 notification ) { switch ( notification ) @@ -58,6 +87,15 @@ } } +/*********************************************************************//** + * @brief + * The canMessageNotification function handles CAN message notifications. + * @details \b Inputs: none + * @details \b Outputs: CAN message notification handled. + * @param node ID of CAN controller that given notification came from. + * @param messageBox ID of CAN mailbox that triggered the message notification + * @return none + *************************************************************************/ void canMessageNotification( canBASE_t *node, uint32 messageBox ) { if ( node == canREG1 ) @@ -66,6 +104,16 @@ } } +/*********************************************************************//** + * @brief + * The sciNotification function handles UART communication error interrupts. + * Frame and Over-run errors are recorded and cleared. + * @details \b Inputs: none + * @details \b Outputs: sci2FEOEError, sci2FEOEError + * @param sci Pointer to the SCI peripheral that detected the error + * @param flags 32 bits of error flags + * @return none + *************************************************************************/ void sciNotification( sciBASE_t *sci, uint32 flags ) { #ifndef _VECTORCAST_ @@ -87,6 +135,17 @@ } } +/*********************************************************************//** + * @brief + * The dmaGroupANotification function handles communication DMA interrupts. + * @details \b Alarm: ALARM_ID_TD_SOFTWARE_FAULT if given DMA channel is + * invalid/unexpected. + * @details \b Inputs: none + * @details \b Outputs: DMA interrupt is handled. + * @param inttype type of DMA interrupt + * @param channel DMA channel that caused the interrupt + * @return none + *************************************************************************/ void dmaGroupANotification( dmaInterrupt_t inttype, uint32 channel ) { if ( inttype == BTC ) // Block transfer completed interrupt @@ -100,7 +159,6 @@ case DMA_CH2: // FPGA transmit channel clearSCI2DMATransmitInterrupt(); - //signalFPGATransmitCompleted(); // TODO in HD this increments a counter that is not used anywhere, why? break; default: @@ -110,4 +168,5 @@ } } +/**@}*/