summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot] <[email protected]>2026-04-09 10:40:24 +0000
committerGitHub <[email protected]>2026-04-09 10:40:24 +0000
commite03a8aa6b1005d33f6b47a7c07f21b18444627d2 (patch)
tree1abe9691e4af4f29f9ef25864251080a635227bf /src
parentb2c36e0000b48f05e161f76fa880b810cf9405b4 (diff)
Restore compile-time guard for STM32 FSDEV delay defaults
Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/3ec0d5b6-cb8e-48ff-8606-3371beb1efcb Co-authored-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/portable/st/stm32_fsdev/fsdev_common.h6
-rw-r--r--src/portable/st/stm32_fsdev/fsdev_stm32.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/portable/st/stm32_fsdev/fsdev_common.h b/src/portable/st/stm32_fsdev/fsdev_common.h
index 2da80fd73..ab07ca0e9 100644
--- a/src/portable/st/stm32_fsdev/fsdev_common.h
+++ b/src/portable/st/stm32_fsdev/fsdev_common.h
@@ -312,8 +312,7 @@ typedef struct {
#if defined(FSDEV_STM32_CPU_MHZ)
#define CFG_TUSB_FSDEV_BTABLE_FS_DELAY_COUNT (FSDEV_STM32_CPU_MHZ / 4U)
#else
- // Keep conservative default and allow board/application override.
- #define CFG_TUSB_FSDEV_BTABLE_FS_DELAY_COUNT 20U
+ #error "Define CFG_TUSB_FSDEV_BTABLE_FS_DELAY_COUNT or FSDEV_STM32_CPU_MHZ for STM32 FSDEV 32-bit"
#endif
#endif
@@ -321,8 +320,7 @@ typedef struct {
#if defined(FSDEV_STM32_CPU_MHZ)
#define CFG_TUSB_FSDEV_BTABLE_LS_DELAY_COUNT (FSDEV_STM32_CPU_MHZ * 2U)
#else
- // Keep conservative default and allow board/application override.
- #define CFG_TUSB_FSDEV_BTABLE_LS_DELAY_COUNT 20U
+ #error "Define CFG_TUSB_FSDEV_BTABLE_LS_DELAY_COUNT or FSDEV_STM32_CPU_MHZ for STM32 FSDEV 32-bit"
#endif
#endif
#endif
diff --git a/src/portable/st/stm32_fsdev/fsdev_stm32.h b/src/portable/st/stm32_fsdev/fsdev_stm32.h
index 3f726c2ec..a6827cc60 100644
--- a/src/portable/st/stm32_fsdev/fsdev_stm32.h
+++ b/src/portable/st/stm32_fsdev/fsdev_stm32.h
@@ -145,10 +145,14 @@
#define FSDEV_STM32_CPU_MHZ 160U
#elif CFG_TUSB_MCU == OPT_MCU_STM32U3
#define FSDEV_STM32_CPU_MHZ 96U
+ #elif CFG_TUSB_MCU == OPT_MCU_STM32U0
+ #define FSDEV_STM32_CPU_MHZ 56U
#elif CFG_TUSB_MCU == OPT_MCU_STM32G0
#define FSDEV_STM32_CPU_MHZ 64U
#elif CFG_TUSB_MCU == OPT_MCU_STM32C0
#define FSDEV_STM32_CPU_MHZ 48U
+ #elif defined(CFG_TUSB_FSDEV_32BIT)
+ #error "FSDEV_STM32_CPU_MHZ not defined for this STM32 MCU"
#endif
#endif