Skip to content

Commit aa9cf73

Browse files
dpgeorgeAnton-2
authored andcommitted
stm32/usbd_conf: Fix build for boards with USB disabled.
Some boards (eg NUCLEO_G0B1RE and NUCLEO_G474RE) have USB disabled but still configure MICROPY_HW_USB_FS/HS for the cases where USB does get enabled. Such a configuration should not build any of the code in `usbd_conf.c`, nor the USB interrupt handlers. Signed-off-by: Damien George <damien@micropython.org>
1 parent e325f59 commit aa9cf73

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ports/stm32/stm32_it.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ void DebugMon_Handler(void) {
301301
/* file (startup_stm32f4xx.s). */
302302
/******************************************************************************/
303303

304+
#if MICROPY_HW_STM_USB_STACK || MICROPY_HW_TINYUSB_STACK
305+
304306
#if defined(STM32G0)
305307

306308
#if MICROPY_HW_USB_FS
@@ -499,6 +501,8 @@ void OTG_HS_WKUP_IRQHandler(void) {
499501

500502
#endif // !defined(STM32L0)
501503

504+
#endif // MICROPY_HW_STM_USB_STACK || MICROPY_HW_TINYUSB_STACK
505+
502506
/**
503507
* @brief This function handles PPP interrupt request.
504508
* @param None

ports/stm32/usbd_conf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "irq.h"
3737
#include "usb.h"
3838

39-
#if MICROPY_HW_USB_FS || MICROPY_HW_USB_HS
39+
#if MICROPY_HW_STM_USB_STACK || MICROPY_HW_TINYUSB_STACK
4040

4141
#if BUILDING_MBOOT
4242
// TinyUSB not used in mboot

0 commit comments

Comments
 (0)