summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authoralt-0191 <[email protected]>2026-03-13 22:57:18 +0800
committeralt-0191 <[email protected]>2026-03-18 15:23:28 +0800
commit56f94bbb46bebf88e9be0332ebb9db03b30d1cb1 (patch)
tree9efdc27d60d2989994ec582ae6eec3a39c48c36c /hw
parenta2ea022e96ac2c9d4b945f30081d195002fb88d9 (diff)
dcd_ch58x: fix toggle, SETUP race, and bus reset handling
- Switch from AUTO_TOG to manual toggle for all endpoints to fix toggle mismatch after clear-stall causing bus resets - Fix SETUP race condition: track ep0_completion_pending and setup_pending to avoid arming stale EP0 transfers - Defer Set Address to ISR after status ZLP is ACK'd - Improve bus reset: reset all EPs, clear pending state - Fix EP4 DMA macro to correctly map to EP0 base (0x10) - Move CH58X_UIS_TOG_OK to common section (used by both DCD/HCD) - Add #ifndef guards for BOARD_TUD/TUH_RHPORT in board.h - Track isochronous per direction: isochronous[ep][dir] - NAK EP0 OUT on completion to prevent premature data acceptance
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/ch58x/boards/yd-ch582m/board.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/bsp/ch58x/boards/yd-ch582m/board.h b/hw/bsp/ch58x/boards/yd-ch582m/board.h
index 6e25dbdd3..a14ffd198 100644
--- a/hw/bsp/ch58x/boards/yd-ch582m/board.h
+++ b/hw/bsp/ch58x/boards/yd-ch582m/board.h
@@ -47,8 +47,12 @@ extern "C" {
// Dual-port: USB1 (rhport 0) = Device, USB2 (rhport 1) = Host
// Swap these two if you want the opposite assignment
+#ifndef BOARD_TUD_RHPORT
#define BOARD_TUD_RHPORT 0
+#endif
+#ifndef BOARD_TUH_RHPORT
#define BOARD_TUH_RHPORT 1
+#endif
#ifdef __cplusplus
}