123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- /*!
- \file gd32f3x0_it.c
- \brief interrupt service routines
- */
- /*
- Copyright (C) 2017 GigaDevice
- 2017-06-06, V1.0.0, firmware for GD32F3x0
- */
- #include "gd32f30x_it.h"
- #include "can_driver.h"
- extern uint8_t data;
- /*!
- \brief this function handles NMI exception
- \param[in] none
- \param[out] none
- \retval none
- */
- void NMI_Handler(void)
- {
- }
- /*!
- \brief this function handles HardFault exception
- \param[in] none
- \param[out] none
- \retval none
- */
- void HardFault_Handler(void)
- {
- /* if Hard Fault exception occurs, go to infinite loop */
- while (1);
- }
- /*!
- \brief this function handles MemManage exception
- \param[in] none
- \param[out] none
- \retval none
- */
- void MemManage_Handler(void)
- {
- /* if Memory Manage exception occurs, go to infinite loop */
- while (1);
- }
- /*!
- \brief this function handles BusFault exception
- \param[in] none
- \param[out] none
- \retval none
- */
- void BusFault_Handler(void)
- {
- /* if Bus Fault exception occurs, go to infinite loop */
- while (1);
- }
- /*!
- \brief this function handles UsageFault exception
- \param[in] none
- \param[out] none
- \retval none
- */
- void UsageFault_Handler(void)
- {
- /* if Usage Fault exception occurs, go to infinite loop */
- while (1);
- }
- /*!
- \brief this function handles SVC exception
- \param[in] none
- \param[out] none
- \retval none
- */
- void SVC_Handler(void)
- {
- }
- /*!
- \brief this function handles DebugMon exception
- \param[in] none
- \param[out] none
- \retval none
- */
- void DebugMon_Handler(void)
- {
- }
- /*!
- \brief this function handles PendSV exception
- \param[in] none
- \param[out] none
- \retval none
- */
- void PendSV_Handler(void)
- {
- }
- /*!
- \brief this function handles SysTick exception
- \param[in] none
- \param[out] none
- \retval none
- */
- void SysTick_Handler(void)
- {
- /* Add your code below */
- }
- /*!
- \brief
- \param[in] none
- \param[out] none
- \retval none
- */
- void ADC0_1_IRQHandler(void)
- {
-
- }
- /*!
- \brief
- \param[in] none
- \param[out] none
- \retval none
- */
- void TIMER0_UP_TIMER9_IRQHandler(void)
- {
-
- }
- /*!
- \brief
- \param[in] none
- \param[out] none
- \retval none
- */
- void TIMER1_IRQHandler(void)
- {
-
- }
- /*!
- \brief
- \param[in] none
- \param[out] none
- \retval none
- */
- void TIMER3_IRQHandler(void)
- {
-
- }
- /*!
- \brief
- \param[in] none
- \param[out] none
- \retval none
- */
- void TIMER5_IRQHandler(void)
- {
-
- }
- /*!
- \brief
- \param[in] none
- \param[out] none
- \retval none
- */
- void USART0_IRQHandler(void)
- {
- }
- /*!
- \brief
- \param[in] none
- \param[out] none
- \retval none
- */
- void DMA1_Channel2_IRQHandler(void)
- {
-
- }
- /*!
- \brief
- \param[in] none
- \param[out] none
- \retval none
- */
- UWORD uwCnts = 0;
- void CAN0_RX0_IRQHandler(void)
- {
- can_message_receive(CAN0, CAN_FIFO0, pRxMsg);
- if((pRxMsg->rx_ff != CAN_FF_STANDARD) || (pRxMsg->rx_dlen == 0))
- {
- can_interrupt_enable(CAN0, CAN_INT_RFF0);
- return;
- }
-
- switch (pRxMsg->rx_sfid)
- {
- case ID_PBU_BC:
- case ID_PBU_TO_MC: //接收PBU数据
- {
- CAN_RxBuf_Struct_PBU.ucBufID = pRxMsg->rx_sfid;
- CAN_Rx_ISR(&CAN_RxBuf_Struct_PBU, pRxMsg->rx_dlen);
- break;
- }
- case ID_BMS_BC:
- case ID_BMS_TO_MC: //接收BMS数据
- {
- CAN_RxBuf_Struct_BMS.ucBufID = pRxMsg->rx_sfid;
- CAN_Rx_ISR(&CAN_RxBuf_Struct_BMS, pRxMsg->rx_dlen);
- break;
- }
- case ID_HMI_BC:
- case ID_HMI_TO_MC: //接收HMI数据
- {
- CAN_RxBuf_Struct_HMI.ucBufID = pRxMsg->rx_sfid;
- CAN_Rx_ISR(&CAN_RxBuf_Struct_HMI, pRxMsg->rx_dlen);
- break;
- }
- case ID_CDL_BC:
- case ID_CDL_TO_MC: // case ID_CDL_TO_MC_TE://接收CDL数据
- {
- CAN_RxBuf_Struct_CDL.ucBufID = pRxMsg->rx_sfid;
- CAN_Rx_ISR(&CAN_RxBuf_Struct_CDL, pRxMsg->rx_dlen);
- break;
- }
- default:
- break;
- }
-
- can_interrupt_enable(CAN0, CAN_INT_RFF0);
- }
- void CAN0_RX1_IRQHandler(void)
- {
- }
|