summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2025-05-23 21:50:00 +0700
committerGitHub <[email protected]>2025-05-23 21:50:00 +0700
commit8f077f9295838d6a7e7a5151cb46605df14a630d (patch)
tree1f543f39eb58c47bccdaa399693802845f37012c /src/portable
parentd3a9fee5cbd2490fa3d1e3976169e0c40e5a5e0c (diff)
parent1a13bd8eba883aa9d1fda8f95823db8217c912f4 (diff)
Merge pull request #3111 from hathach/ci_vbus
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/chipidea/ci_hs/dcd_ci_hs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/portable/chipidea/ci_hs/dcd_ci_hs.c b/src/portable/chipidea/ci_hs/dcd_ci_hs.c
index a716dc24c..244f5a2d4 100644
--- a/src/portable/chipidea/ci_hs/dcd_ci_hs.c
+++ b/src/portable/chipidea/ci_hs/dcd_ci_hs.c
@@ -239,7 +239,11 @@ bool dcd_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
usbmode |= USBMODE_CM_DEVICE;
dcd_reg->USBMODE = usbmode;
+#ifdef CFG_TUD_CI_HS_VBUS_CHARGE
+ dcd_reg->OTGSC = OTGSC_VBUS_CHARGE | OTGSC_OTG_TERMINATION;
+#else
dcd_reg->OTGSC = OTGSC_VBUS_DISCHARGE | OTGSC_OTG_TERMINATION;
+#endif
#if !TUD_OPT_HIGH_SPEED
dcd_reg->PORTSC1 = PORTSC1_FORCE_FULL_SPEED;