Skip to content

Commit 721ccf9

Browse files
authored
Revert "Fix issue with USB CDC at reboot" (#237)
***NO_CI***
1 parent 8e22859 commit 721ccf9

File tree

1 file changed

+11
-14
lines changed
  • ChibiOS/NESHTEC_NESHNODE_V1/nanoCLR

1 file changed

+11
-14
lines changed

ChibiOS/NESHTEC_NESHNODE_V1/nanoCLR/main.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ int main(void)
7474
crcStart(NULL);
7575
#endif
7676

77+
// Initializes a serial-over-USB CDC driver.
78+
sduObjectInit(&SDU1);
79+
sduStart(&SDU1, &serusbcfg);
80+
81+
// Activates the USB driver and then the USB bus pull-up on D+.
82+
// Note, a delay is inserted in order to not have to disconnect the cable after a reset
83+
usbDisconnectBus(serusbcfg.usbp);
84+
chThdSleepMilliseconds(100);
85+
usbStart(serusbcfg.usbp, &usbcfg);
86+
usbConnectBus(serusbcfg.usbp);
87+
7788
// create the receiver thread
7889
osThreadCreate(osThread(ReceiverThread), NULL);
7990

@@ -97,17 +108,3 @@ int main(void)
97108
osDelay(100);
98109
}
99110
}
100-
101-
void WP_Message_PrepareReception_Target()
102-
{
103-
// Initializes a serial-over-USB CDC driver.
104-
sduObjectInit(&SDU1);
105-
sduStart(&SDU1, &serusbcfg);
106-
107-
// Activates the USB driver and then the USB bus pull-up on D+.
108-
// Note, a delay is inserted in order to not have to disconnect the cable after a reset
109-
usbDisconnectBus(serusbcfg.usbp);
110-
chThdSleepMilliseconds(100);
111-
usbStart(serusbcfg.usbp, &usbcfg);
112-
usbConnectBus(serusbcfg.usbp);
113-
}

0 commit comments

Comments
 (0)