diff options
| author | Jie Feng <[email protected]> | 2026-07-20 01:15:19 +0800 |
|---|---|---|
| committer | Jie Feng <[email protected]> | 2026-07-20 01:15:19 +0800 |
| commit | cd2006382d422eab2e362d364f3b1c60108c73dd (patch) | |
| tree | 80a61b000f86421ca1921bfc536c2031be04f75a | |
| parent | 9418aba918d7c4107026c894e863d9ef0ec5db81 (diff) | |
return false on too large ep sizes
| -rw-r--r-- | src/portable/mentor/musb/dcd_musb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/portable/mentor/musb/dcd_musb.c b/src/portable/mentor/musb/dcd_musb.c index 7d79a089a..249868b75 100644 --- a/src/portable/mentor/musb/dcd_musb.c +++ b/src/portable/mentor/musb/dcd_musb.c @@ -235,10 +235,10 @@ TU_ATTR_ALWAYS_INLINE static inline bool hwfifo_config(musb_regs_t* musb, unsign (void) mps; #if defined(TUP_USBIP_MUSB_PY32) - (void) musb; (void) epnum; (void) is_rx; (void) mps; (void) double_packet; + (void) musb; (void) is_rx; (void) double_packet; // Puya FIFO sizes: EP0 = 64 B, EP1 = 512 B, EP2..4 = 128 B, EP5 = 64 B, shared between IN and OUT. - //static const uint16_t py32_fifo_size[] = { 64, 512, 128, 128, 128, 64 }; - //TU_VERIFY(epnum < TU_ARRAY_SIZE(py32_fifo_size) && mps <= py32_fifo_size[epnum]); + static const uint16_t py32_fifo_size[] = { 64, 512, 128, 128, 128, 64 }; + return epnum < TU_ARRAY_SIZE(py32_fifo_size) && mps <= py32_fifo_size[epnum]; #elif defined(TUP_USBIP_MUSB_ADI) // AnalogDevice FIFO sizes: EP1..7 = 512 B, EP8..9 = 2048 B, EP10..11 = 4096 B. // DPB requires FIFO >= 2 * MPS. For HS bulk (MPS=512) only EP >= 8 qualifies. |
