diff --git a/ChibiOS/NESHTEC_NESHNODE_V1/nanoCLR/main.c b/ChibiOS/NESHTEC_NESHNODE_V1/nanoCLR/main.c index 35bd29df..492738f6 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