| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- /********************************** (C) COPYRIGHT *******************************
- * File Name : ch32v20x_it.c
- * Author : WCH
- * Version : V1.0.0
- * Date : 2022/06/16
- * Description : Main Interrupt Service Routines.
- *********************************************************************************
- * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
- * Attention: This software (modified or not) and binary are used for
- * microcontroller manufactured by Nanjing Qinheng Microelectronics.
- *******************************************************************************/
- /*********************************************************************
- * INCLUDES
- */
- #include <user_config.h>
- #include "ch32v20x_it.h"
- #include "user_nfc.h"
- #include "user_adc.h"
- #include "user_can.h"
- /*********************************************************************
- * LOCAL FUNCTIONS
- */
- void NMI_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
- void HardFault_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
- void BB_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
- void DMA1_Channel1_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
- void USB_LP_CAN1_RX0_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
- /*********************************************************************
- * @fn NMI_Handler
- *
- * @brief This function handles NMI exception.
- *
- * @return None
- */
- void NMI_Handler(void)
- {
- }
- /*********************************************************************
- * @fn HardFault_Handler
- *
- * @brief This function handles Hard Fault exception.
- *
- * @return None
- */
- void HardFault_Handler(void)
- {
- while(1)
- {
- }
- }
- /*********************************************************************
- * @fn BB_IRQHandler
- *
- * @brief BB Interrupt for BLE.
- *
- * @return None
- */
- void BB_IRQHandler(void)
- {
- BB_IRQLibHandler();
- }
- ///*********************************************************************
- // * @fn LLE_IRQHandler
- // *
- // * @brief LLE Interrupt for BLE.
- // *
- // * @return None
- // */
- //void LLE_IRQHandler(void)
- //{
- // LLE_IRQLibHandler();
- //}
- void DMA1_Channel1_IRQHandler(void)
- {
- if(DMA_GetITStatus(DMA1_IT_TC1))
- {
- DMA_ClearITPendingBit(DMA1_IT_TC1);
- vUser_adc_dma_finish();
- }
- }
- // CAN接收中断服务函数
- void USB_LP_CAN1_RX0_IRQHandler(void)
- {
- if(CAN_GetITStatus(CAN1, CAN_IT_FMP0)) // 检查FIFO0消息挂起中断
- {
- CanRxMsg RxMessage;
- CAN_Receive(CAN_TYPE, CAN_FIFO0, &RxMessage);
- vUser_can_recv_data(&RxMessage);
- // 清除中断标志
- CAN_ClearITPendingBit(CAN1, CAN_IT_FMP0);
- }
- }
|