From 721ccf9536390225a4d03484ab4ad29b37bb49b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 29 Apr 2024 16:52:13 +0100 Subject: [PATCH] Revert "Fix issue with USB CDC at reboot" (#237) ***NO_CI*** --- ChibiOS/NESHTEC_NESHNODE_V1/nanoCLR/main.c | 25 ++++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/ChibiOS/NESHTEC_NESHNODE_V1/nanoCLR/main.c b/ChibiOS/NESHTEC_NESHNODE_V1/nanoCLR/main.c index 35bd29d..492738f 100644 --- a/ChibiOS/NESHTEC_NESHNODE_V1/nanoCLR/main.c +++ b/ChibiOS/NESHTEC_NESHNODE_V1/nanoCLR/main.c @@ -74,6 +74,17 @@ int main(void) crcStart(NULL); #endif + // Initializes a serial-over-USB CDC driver. + sduObjectInit(&SDU1); + sduStart(&SDU1, &serusbcfg); + + // Activates the USB driver and then the USB bus pull-up on D+. + // Note, a delay is inserted in order to not have to disconnect the cable after a reset + usbDisconnectBus(serusbcfg.usbp); + chThdSleepMilliseconds(100); + usbStart(serusbcfg.usbp, &usbcfg); + usbConnectBus(serusbcfg.usbp); + // create the receiver thread osThreadCreate(osThread(ReceiverThread), NULL); @@ -97,17 +108,3 @@ int main(void) osDelay(100); } } - -void WP_Message_PrepareReception_Target() -{ - // Initializes a serial-over-USB CDC driver. - sduObjectInit(&SDU1); - sduStart(&SDU1, &serusbcfg); - - // Activates the USB driver and then the USB bus pull-up on D+. - // Note, a delay is inserted in order to not have to disconnect the cable after a reset - usbDisconnectBus(serusbcfg.usbp); - chThdSleepMilliseconds(100); - usbStart(serusbcfg.usbp, &usbcfg); - usbConnectBus(serusbcfg.usbp); -} \ No newline at end of file