summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorJie Feng <[email protected]>2026-06-11 22:31:26 +0800
committerJie Feng <[email protected]>2026-07-19 19:24:40 +0800
commit67a28ae7535100afc80366f29cee5fad01c9bc6f (patch)
treeea51ce927325616794a6fd247293f0b1278e96b0 /src/portable
parente7458103240919482f4a803f239af4ca0e1a459f (diff)
cleanup
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/mentor/musb/dcd_musb.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/portable/mentor/musb/dcd_musb.c b/src/portable/mentor/musb/dcd_musb.c
index 45c6fe7df..0a174065f 100644
--- a/src/portable/mentor/musb/dcd_musb.c
+++ b/src/portable/mentor/musb/dcd_musb.c
@@ -735,29 +735,39 @@ void dcd_remote_wakeup(uint8_t rhport) {
musb_regs->power &= ~MUSB_POWER_RESUME;
}
+#if defined(TUP_USBIP_MUSB_PY32)
+
// Connect by enabling internal pull-up resistor on D+/D-
void dcd_connect(uint8_t rhport)
{
- musb_regs_t* musb_regs = MUSB_REGS(rhport);
-#if defined(TUP_USBIP_MUSB_PY32)
- (void) musb_regs;
+ (void) rhport;
+}
+
+// Disconnect by disabling internal pull-up resistor on D+/D-
+void dcd_disconnect(uint8_t rhport)
+{
+ (void) rhport;
+}
+
#else
+
+// Connect by enabling internal pull-up resistor on D+/D-
+void dcd_connect(uint8_t rhport)
+{
+ musb_regs_t* musb_regs = MUSB_REGS(rhport);
musb_regs->power |= TUD_OPT_HIGH_SPEED ? MUSB_POWER_HSENAB : 0;
musb_regs->power |= MUSB_POWER_SOFTCONN;
-#endif
}
// Disconnect by disabling internal pull-up resistor on D+/D-
void dcd_disconnect(uint8_t rhport)
{
musb_regs_t* musb_regs = MUSB_REGS(rhport);
-#if defined(TUP_USBIP_MUSB_PY32)
- (void) musb_regs;
-#else
musb_regs->power &= ~MUSB_POWER_SOFTCONN;
-#endif
}
+#endif
+
void dcd_sof_enable(uint8_t rhport, bool en)
{
(void) rhport;