Files
player/Project/Src/MY/stm32f4xx_it.c
2025-09-21 19:14:09 +08:00

267 lines
5.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/***
***************************************************************************
* @file stm32f4xx_it.c
* @brief 中断服务函数
***************************************************************************
* @description
*
* 此文件存放了STM32所有的异常操作和中断服务函数
*
***************************************************************************
***/
#include "stm32f4xx_it.h"
#include "sdio_sd.h"
#include "stdbool.h"
#include "tusb.h"
/** @addtogroup Template_Project
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/******************************************************************************/
/* Cortex-M4 Processor Exceptions Handlers */
/******************************************************************************/
/**
* @brief This function handles NMI exception.
* @param None
* @retval None
*/
void NMI_Handler(void)
{
}
/**
* @brief This function handles Hard Fault exception.
* @param None
* @retval None
*/
//void HardFault_Handler(void)
//{
// /* Go to infinite loop when Hard Fault exception occurs */
// while (1)
// {
// }
//}
/**
* @brief This function handles Memory Manage exception.
* @param None
* @retval None
*/
void MemManage_Handler(void)
{
/* Go to infinite loop when Memory Manage exception occurs */
while (1)
{
}
}
/**
* @brief This function handles Bus Fault exception.
* @param None
* @retval None
*/
void BusFault_Handler(void)
{
/* Go to infinite loop when Bus Fault exception occurs */
while (1)
{
}
}
/**
* @brief This function handles Usage Fault exception.
* @param None
* @retval None
*/
void UsageFault_Handler(void)
{
/* Go to infinite loop when Usage Fault exception occurs */
while (1)
{
}
}
/**
* @brief This function handles SVCall exception.
* @param None
* @retval None
*/
void SVC_Handler(void)
{
}
/**
* @brief This function handles Debug Monitor exception.
* @param None
* @retval None
*/
void DebugMon_Handler(void)
{
}
/******************************************************************************/
/* STM32F4xx Peripherals Interrupt Handlers */
/* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
/* available peripheral interrupt handler's name please refer to the startup */
/* file (startup_stm32f4xx.s). */
/******************************************************************************/
extern void LTDC_ISR_Handler(void);
// 函数:LTDC中断服务函数
// 说明在emWin_Drive.c里被调用
//
void LTDC_IRQHandler(void)
{
LTDC_ISR_Handler();
}
// 函数SD卡全局中断
void SDIO_IRQHandler(void)
{
/* Process All SDIO Interrupt Sources */
SD_ProcessIRQSrc();
}
// 函数SD卡DMA中断
void SD_SDIO_DMA_IRQHANDLER(void)
{
/* Process DMA2 Stream3 or DMA2 Stream6 Interrupt Sources */
SD_ProcessDMAIRQ();
}
/************************USB中断******************************************/
// #include "usb_core.h"
// #include "usbd_core.h"
// #include "usb_conf.h"
// #include "usb_bsp.h"
#if 1
#ifdef USE_USB_OTG_HS
void OTG_HS_IRQHandler(void)
{
extern void USBD_OTG_ISR_USER (void);
USBD_OTG_ISR_USER ();
}
#endif
#ifdef USE_USB_OTG_FS
void OTG_FS_IRQHandler(void)
{
USBD_OTG_ISR_Handler (&USB_OTG_dev);
}
#endif
#ifdef USB_OTG_HS_DEDICATED_EP1_ENABLED
void OTG_HS_EP1_IN_IRQHandler(void)
{
extern void OTG_HS_EP1_IN_ISR_USER (void);
OTG_HS_EP1_IN_ISR_USER ();
}
void OTG_HS_EP1_OUT_IRQHandler(void)
{
extern void OTG_HS_EP1_OUT_ISR_USER (void);
OTG_HS_EP1_OUT_ISR_USER();
}
#endif
#if PKG_TINYUSB_DEVICE_ENABLE
void OTG_FS_IRQHandler(void) {
tusb_int_handler(0, true);
}
void OTG_HS_IRQHandler(void) {
tusb_int_handler(1, true);
}
#endif
#else
extern USB_OTG_CORE_HANDLE USB_OTG_dev;
extern uint32_t USBD_OTG_ISR_Handler (USB_OTG_CORE_HANDLE *pdev);
#ifdef USB_OTG_HS_DEDICATED_EP1_ENABLED
extern uint32_t USBD_OTG_EP1IN_ISR_Handler (USB_OTG_CORE_HANDLE *pdev);
extern uint32_t USBD_OTG_EP1OUT_ISR_Handler (USB_OTG_CORE_HANDLE *pdev);
#endif
#ifdef USE_USB_OTG_HS
void OTG_HS_IRQHandler(void)
#else
void OTG_FS_IRQHandler(void)
#endif
{
USBD_OTG_ISR_Handler (&USB_OTG_dev);
}
#ifdef USB_OTG_HS_DEDICATED_EP1_ENABLED
/**
* @brief This function handles EP1_IN Handler.
* @param None
* @retval None
*/
void OTG_HS_EP1_IN_IRQHandler(void)
{
USBD_OTG_EP1IN_ISR_Handler (&USB_OTG_dev);
}
/**
* @brief This function handles EP1_OUT Handler.
* @param None
* @retval None
*/
void OTG_HS_EP1_OUT_IRQHandler(void)
{
USBD_OTG_EP1OUT_ISR_Handler (&USB_OTG_dev);
}
#endif
#endif
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/