2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
23 #include "stm32f4xx_it.h"
24 #include "stm32f4xx_conf.h"
27 #include "usbd_core.h"
28 #include "usbd_cdc_core.h"
30 extern uint32_t USBD_OTG_ISR_Handler (USB_OTG_CORE_HANDLE
*pdev
);
31 extern USB_OTG_CORE_HANDLE USB_OTG_dev
;
33 #ifdef USB_OTG_HS_DEDICATED_EP1_ENABLED
34 extern uint32_t USBD_OTG_EP1IN_ISR_Handler (USB_OTG_CORE_HANDLE
*pdev
);
35 extern uint32_t USBD_OTG_EP1OUT_ISR_Handler (USB_OTG_CORE_HANDLE
*pdev
);
39 * @brief This function handles NMI exception.
43 void NMI_Handler(void)
48 * @brief This function handles SVCall exception.
52 void SVC_Handler(void)
57 * @brief This function handles Debug Monitor exception.
61 void DebugMon_Handler(void)
66 * @brief This function handles PendSVC exception.
70 void PendSV_Handler(void)
74 /******************************************************************************/
75 /* STM32F4xx Peripherals Interrupt Handlers */
76 /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
77 /* available peripheral interrupt handler's name please refer to the startup */
78 /* file (startup_stm32f4xx.s). */
79 /******************************************************************************/
82 void OTG_FS_WKUP_IRQHandler(void)
84 if (USB_OTG_dev
.cfg
.low_power
)
86 *(uint32_t *)(0xE000ED10) &= 0xFFFFFFF9 ;
88 USB_OTG_UngateClock(&USB_OTG_dev
);
90 EXTI_ClearITPendingBit(EXTI_Line18
);
95 * @brief This function handles EXTI15_10_IRQ Handler.
100 void OTG_HS_WKUP_IRQHandler(void)
102 if (USB_OTG_dev
.cfg
.low_power
)
104 *(uint32_t *)(0xE000ED10) &= 0xFFFFFFF9 ;
106 USB_OTG_UngateClock(&USB_OTG_dev
);
108 EXTI_ClearITPendingBit(EXTI_Line20
);
113 * @brief This function handles OTG_HS Handler.
117 #ifdef USE_USB_OTG_HS
118 void OTG_HS_IRQHandler(void)
120 void OTG_FS_IRQHandler(void)
123 USBD_OTG_ISR_Handler (&USB_OTG_dev
);
126 #ifdef USB_OTG_HS_DEDICATED_EP1_ENABLED
128 * @brief This function handles EP1_IN Handler.
132 void OTG_HS_EP1_IN_IRQHandler(void)
134 USBD_OTG_EP1IN_ISR_Handler (&USB_OTG_dev
);
138 * @brief This function handles EP1_OUT Handler.
142 void OTG_HS_EP1_OUT_IRQHandler(void)
144 USBD_OTG_EP1OUT_ISR_Handler (&USB_OTG_dev
);