Skip to content

Commit cd3b98c

Browse files
hathachclaude
andcommitted
add TUP_USBIP_FSDEV_HAS_HOST define for FSDEV MCUs with host support
Add TUP_USBIP_FSDEV_HAS_HOST to tusb_mcu.h for STM32 C0, G0, H5, U3, and U5 (fsdev variants) that have DRD host mode capability. Use this define in hcd_stm32_fsdev.c compile guard instead of enumerating MCUs with TU_CHECK_MCU, so new host-capable FSDEV MCUs only need to define TUP_USBIP_FSDEV_HAS_HOST in tusb_mcu.h. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e336045 commit cd3b98c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/common/tusb_mcu.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@
202202
#elif TU_CHECK_MCU(OPT_MCU_STM32C0)
203203
#define TUP_USBIP_FSDEV
204204
#define TUP_USBIP_FSDEV_STM32
205+
#define TUP_USBIP_FSDEV_DRD
205206
#define CFG_TUSB_FSDEV_PMA_SIZE 2048u
206207

207208
#elif TU_CHECK_MCU(OPT_MCU_STM32F0)
@@ -278,6 +279,7 @@
278279
#elif TU_CHECK_MCU(OPT_MCU_STM32G0)
279280
#define TUP_USBIP_FSDEV
280281
#define TUP_USBIP_FSDEV_STM32
282+
#define TUP_USBIP_FSDEV_DRD
281283
#define CFG_TUSB_FSDEV_PMA_SIZE 2048u
282284

283285
#elif TU_CHECK_MCU(OPT_MCU_STM32G4)
@@ -293,6 +295,7 @@
293295
#elif TU_CHECK_MCU(OPT_MCU_STM32H5)
294296
#define TUP_USBIP_FSDEV
295297
#define TUP_USBIP_FSDEV_STM32
298+
#define TUP_USBIP_FSDEV_DRD
296299
#define CFG_TUSB_FSDEV_PMA_SIZE 2048u
297300

298301
#elif TU_CHECK_MCU(OPT_MCU_STM32H7)
@@ -366,13 +369,15 @@
366369
#elif TU_CHECK_MCU(OPT_MCU_STM32U3)
367370
#define TUP_USBIP_FSDEV
368371
#define TUP_USBIP_FSDEV_STM32
372+
#define TUP_USBIP_FSDEV_DRD
369373
#define CFG_TUSB_FSDEV_PMA_SIZE 2048u
370374

371375
#elif TU_CHECK_MCU(OPT_MCU_STM32U5)
372376
// U535/545 use fsdev
373377
#if defined(STM32U535xx) || defined(STM32U545xx)
374378
#define TUP_USBIP_FSDEV
375379
#define TUP_USBIP_FSDEV_STM32
380+
#define TUP_USBIP_FSDEV_DRD
376381
#define CFG_TUSB_FSDEV_PMA_SIZE 2048u
377382
#else
378383
#define TUP_USBIP_DWC2

src/portable/st/stm32_fsdev/hcd_stm32_fsdev.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838

3939
#include "tusb_option.h"
4040

41-
#if CFG_TUH_ENABLED && defined(TUP_USBIP_FSDEV) && \
42-
TU_CHECK_MCU(OPT_MCU_STM32C0, OPT_MCU_STM32G0, OPT_MCU_STM32H5, OPT_MCU_STM32U3, OPT_MCU_STM32U5)
41+
#if CFG_TUH_ENABLED && defined(TUP_USBIP_FSDEV) && defined(TUP_USBIP_FSDEV_DRD)
4342

4443
#include "host/hcd.h"
4544
#include "host/usbh.h"

0 commit comments

Comments
 (0)