summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot] <[email protected]>2026-04-10 10:53:03 +0000
committerGitHub <[email protected]>2026-04-10 10:53:03 +0000
commit048bb5ca690311a24cae69fd177bd2f4721f27b6 (patch)
tree71b906a79b61b9b5e8bff8c62a22b84c422dfb2e
parent41575d2de943393f6cc7e5228ab904614fadce28 (diff)
Make fsdev errata delay helper static inline
Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/8588a09c-d4e5-4284-8944-47ae4e2a2a1f Co-authored-by: HiFiPhile <[email protected]>
-rw-r--r--src/portable/st/stm32_fsdev/fsdev_common.c17
-rw-r--r--src/portable/st/stm32_fsdev/fsdev_common.h12
2 files changed, 11 insertions, 18 deletions
diff --git a/src/portable/st/stm32_fsdev/fsdev_common.c b/src/portable/st/stm32_fsdev/fsdev_common.c
index e6c95e12d..003bcd069 100644
--- a/src/portable/st/stm32_fsdev/fsdev_common.c
+++ b/src/portable/st/stm32_fsdev/fsdev_common.c
@@ -113,21 +113,4 @@ void btable_set_rx_bufsize(uint32_t ep_id, uint8_t buf_id, uint16_t wCount) {
#endif
}
-/* STM32 FSDEV PMA Buffer Description Table errata workaround:
- * - ES0561 (STM32H503), ES0587 (STM32U535/U545)
- * - CTR may trigger before final PMA SRAM accesses complete on OUT transfers.
- * - Insert delay before reading PMA count/data.
- */
-void fsdev_btable_workaround_delay(bool low_speed) {
-#if defined(TUP_USBIP_FSDEV_STM32) && defined(CFG_TUSB_FSDEV_32BIT)
- uint32_t cycle_count = low_speed ? CFG_TUSB_FSDEV_BTABLE_LS_DELAY_COUNT : CFG_TUSB_FSDEV_BTABLE_FS_DELAY_COUNT;
- volatile uint32_t delay_count = cycle_count;
- while (delay_count > 0U) {
- delay_count--;
- }
-#else
- (void) low_speed;
-#endif
-}
-
#endif
diff --git a/src/portable/st/stm32_fsdev/fsdev_common.h b/src/portable/st/stm32_fsdev/fsdev_common.h
index ab07ca0e9..f5cfa93c8 100644
--- a/src/portable/st/stm32_fsdev/fsdev_common.h
+++ b/src/portable/st/stm32_fsdev/fsdev_common.h
@@ -469,7 +469,17 @@ void btable_set_rx_bufsize(uint32_t ep_id, uint8_t buf_id, uint16_t wCount);
// Delay helper for STM32 FSDEV PMA Buffer Description Table errata (ES0561/ES0587).
// Low-speed path uses CFG_TUSB_FSDEV_BTABLE_LS_DELAY_COUNT, otherwise full-speed count.
-void fsdev_btable_workaround_delay(bool low_speed);
+TU_ATTR_ALWAYS_INLINE static inline void fsdev_btable_workaround_delay(bool low_speed) {
+#if defined(TUP_USBIP_FSDEV_STM32) && defined(CFG_TUSB_FSDEV_32BIT)
+ uint32_t cycle_count = low_speed ? CFG_TUSB_FSDEV_BTABLE_LS_DELAY_COUNT : CFG_TUSB_FSDEV_BTABLE_FS_DELAY_COUNT;
+ volatile uint32_t delay_count = cycle_count;
+ while (delay_count > 0U) {
+ delay_count--;
+ }
+#else
+ (void) low_speed;
+#endif
+}
#ifdef __cplusplus
}