From a2f0c3c1baea4f0129d14d1a85c7fe8b307a2405 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 17 Jul 2026 11:40:15 +0700 Subject: rusb2: restore speed-conditional hwfifo stride mask FS-forced builds on the HS module are not a supported configuration, so the 32-bit access path does not need to exist in full-speed builds: CFG_TUSB_FIFO_HWFIFO_DATA_STRIDE returns to (2 | (TUD_OPT_HIGH_SPEED ? 4 : 0)). Saves 28 bytes of text on FS-only parts (measured on ra4m1_ek cdc_msc); high-speed builds keep both widths for the dual-module (FS+HS ports) case. Build-verified: ra4m1_ek and ra6m5_ek cdc_msc. --- src/tusb_option.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tusb_option.h b/src/tusb_option.h index 65cf747e2..e19ee1629 100644 --- a/src/tusb_option.h +++ b/src/tusb_option.h @@ -376,7 +376,7 @@ //------------ RUSB2 --------------// #if defined(TUP_USBIP_RUSB2) #define CFG_TUD_EDPT_DEDICATED_HWFIFO 1 - #define CFG_TUSB_FIFO_HWFIFO_DATA_STRIDE (2 | 4) // HS module uses 32-bit access at any link speed (e.g. FS-forced build) + #define CFG_TUSB_FIFO_HWFIFO_DATA_STRIDE (2 | (TUD_OPT_HIGH_SPEED ? 4 : 0)) // 16 bit and 32 bit if highspeed #define CFG_TUSB_FIFO_HWFIFO_ADDR_STRIDE 0 #define CFG_TUSB_FIFO_HWFIFO_CUSTOM_WRITE // custom write since rusb2 can change access width 32 -> 16 and can write // odd byte with byte access -- cgit v1.3.1