Index: firmware/App/Services/Interrupts.c =================================================================== diff -u -r84376e65112b149961efe193128cbbd495fafa6c -r8e7158d8231435496fcf1d5649e51babf859ccc7 --- firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 84376e65112b149961efe193128cbbd495fafa6c) +++ firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 8e7158d8231435496fcf1d5649e51babf859ccc7) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file Interrupts.c * -* @author (last) Sean -* @date (last) 12-May-2020 +* @author (last) Sean Nash +* @date (last) 24-Sep-2020 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -48,32 +48,31 @@ #define MAX_COMM_ERRORS 5 ///< Maximum number of a given comm error for a given time window. #define COMM_ERROR_TIME_WINDOW_MS (10 * SEC_PER_MIN * MS_PER_SECOND) ///< Time window for comm error counts. -#define HET1_EDGE_BP_ROTOR_HALL_SENSOR 0 -#define HET1_EDGE_DPI_ROTOR_HALL_SENSOR 1 -#define HET1_EDGE_DPO_ROTOR_HALL_SENSOR 2 +#define HET1_EDGE_BP_ROTOR_HALL_SENSOR 0 ///< HET1 edge detector associated with blood pump rotor hall sensor. +#define HET1_EDGE_DPI_ROTOR_HALL_SENSOR 1 ///< HET1 edge detector associated with dialysate inlet pump rotor hall sensor. +#define HET1_EDGE_DPO_ROTOR_HALL_SENSOR 2 ///< HET1 edge detector associated with dialysate outlet pump rotor hall sensor. // ********** private data ********** #ifdef DEBUG_ENABLED static U32 sci1FrameErrorCnt = 0; static U32 sci1OverrunErrorCnt = 0; #endif -static U32 sci2FrameErrorCnt = 0; -static U32 sci2OverrunErrorCnt = 0; +static U32 sci2FrameErrorCnt = 0; ///< FPGA serial frame error counter. +static U32 sci2OverrunErrorCnt = 0; ///< FPGA serial overrun error counter. -static U32 can1PassiveCnt = 0; -static U32 can1WarningCnt = 0; -static U32 can1BusOffCnt = 0; -static U32 can1ParityCnt = 0; +static U32 can1PassiveCnt = 0; ///< CAN passive mode counter. +static U32 can1WarningCnt = 0; ///< CAN warning mode counter. +static U32 can1BusOffCnt = 0; ///< CAN buss off mode counter. +static U32 can1ParityCnt = 0; ///< CAN parity error counter. // ********** private function prototypes ********** /*********************************************************************//** * @brief * The initInterrupts function initializes the Interrupts module. - * @details - * Inputs : none - * Outputs : Interrupts module initialized. + * @details Inputs: none + * @details Outputs: Interrupts module initialized. * @return none *************************************************************************/ void initInterrupts( void ) @@ -89,9 +88,8 @@ /*********************************************************************//** * @brief * The phantomInterrupt function handles phantom interrupts. - * @details - * Inputs : none - * Outputs : phantom interrupt handled. + * @details Inputs: none + * @details Outputs: phantom interrupt handled. * @return none *************************************************************************/ void phantomInterrupt(void) @@ -111,10 +109,9 @@ /*********************************************************************//** * @brief * The rtiNotification function handles real-time interrupt notifications. - * @details - * Inputs : none - * Outputs : RTI notification handled. - * @param notification : Which RTI timer caused this interrupt. + * @details Inputs: none + * @details Outputs: RTI notification handled. + * @param notification Which RTI timer caused this interrupt * @return none *************************************************************************/ void rtiNotification(uint32 notification) @@ -146,11 +143,10 @@ /*********************************************************************//** * @brief * The canMessageNotification function handles CAN message notifications. - * @details - * Inputs : none - * Outputs : CAN message notification handled. - * @param node : which CAN controller - * @param messageBox : which message box triggered the message notification + * @details Inputs: none + * @details Outputs: CAN message notification handled. + * @param node which CAN controller + * @param messageBox which message box triggered the message notification * @return none *************************************************************************/ void canMessageNotification(canBASE_t *node, uint32 messageBox) @@ -164,14 +160,13 @@ /*********************************************************************//** * @brief * The canErrorNotification function handles CAN error notifications. - * @details - * Inputs : none - * Outputs : CAN error notification handled. - * @param node : which CAN controller - * @param notification : canLEVEL_PASSIVE (0x20) : When RX- or TX error counter are between 32 and 63 \n - * canLEVEL_WARNING (0x40) : When RX- or TX error counter are between 64 and 127 \n - * canLEVEL_BUS_OFF (0x80) : When RX- or TX error counter are between 128 and 255 \n - * canLEVEL_PARITY_ERR (0x100): When parity error detected on CAN RAM read access + * @details Inputs: none + * @details Outputs: CAN error notification handled. + * @param node which CAN controller + * @param notification canLEVEL_PASSIVE (0x20) : When RX- or TX error counter are between 32 and 63 + * canLEVEL_WARNING (0x40) : When RX- or TX error counter are between 64 and 127 + * canLEVEL_BUS_OFF (0x80) : When RX- or TX error counter are between 128 and 255 + * canLEVEL_PARITY_ERR (0x100): When parity error detected on CAN RAM read access * @return none *************************************************************************/ void canErrorNotification(canBASE_t *node, uint32 notification) @@ -239,13 +234,12 @@ /*********************************************************************//** * @brief - * The sciNotification function handles UART communication error interrupts. \n + * The sciNotification function handles UART communication error interrupts. * Frame and Over-run errors are handled. - * @details - * Inputs : none - * Outputs : UART error interrupts handled. - * @param sci : Pointer to the SCI peripheral that detected the error - * @param flags : error flag(s) + * @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) @@ -312,11 +306,10 @@ /*********************************************************************//** * @brief * The dmaGroupANotification function handles communication DMA interrupts. - * @details - * Inputs : none - * Outputs : DMA interrupt is handled. - * @param inttype : type of DMA interrupt - * @param channel : DMA channel that caused the interrupt + * @details Inputs: none + * @details 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) @@ -359,11 +352,10 @@ /*********************************************************************//** * @brief * The edgeNotification function handles rotor hall sensor interrupts. - * @details - * Inputs : none - * Outputs : Rotor hall sensor interrupt is handled according to pin associated with given edge. - * @param hetREG : HET controller associated with the edge. - * @param edge : Which edge was detected. + * @details Inputs: none + * @details Outputs: Rotor hall sensor interrupt is handled according to pin associated with given edge. + * @param hetREG HET controller associated with the edge + * @param edge Which edge was detected * @return none *************************************************************************/ void edgeNotification(hetBASE_t * hetREG, uint32 edge)