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>
This commit is contained in:
Damien George
2025-11-30 08:25:17 +11:00
parent 41acdd8083
commit 9c2b0cd2e3
2 changed files with 5 additions and 1 deletions

View File

@@ -301,6 +301,8 @@ void DebugMon_Handler(void) {
/* file (startup_stm32f4xx.s). */
/******************************************************************************/
#if MICROPY_HW_STM_USB_STACK || MICROPY_HW_TINYUSB_STACK
#if defined(STM32G0)
#if MICROPY_HW_USB_FS
@@ -499,6 +501,8 @@ void OTG_HS_WKUP_IRQHandler(void) {
#endif // !defined(STM32L0)
#endif // MICROPY_HW_STM_USB_STACK || MICROPY_HW_TINYUSB_STACK
/**
* @brief This function handles PPP interrupt request.
* @param None

View File

@@ -36,7 +36,7 @@
#include "irq.h"
#include "usb.h"
#if MICROPY_HW_USB_FS || MICROPY_HW_USB_HS
#if MICROPY_HW_STM_USB_STACK || MICROPY_HW_TINYUSB_STACK
#if BUILDING_MBOOT
// TinyUSB not used in mboot