diff --git a/cores/validation/validation_usb_device/test_usb_device.cpp b/cores/validation/validation_usb_device/test_usb_device.cpp index ddc3060e769133cbb431b306ae6cda434aac1ecf..e69c7193c78366468717e00025fea57ffca61e1e 100644 --- a/cores/validation/validation_usb_device/test_usb_device.cpp +++ b/cores/validation/validation_usb_device/test_usb_device.cpp @@ -27,6 +27,10 @@ void setup(void) { + SERIAL_PORT_MONITOR.begin( 115200 ); + while (!SERIAL_PORT_MONITOR); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection + SERIAL_PORT_MONITOR.println("Start USB device test"); + #ifdef HID_ENABLED Mouse.begin(); @@ -37,11 +41,11 @@ void setup(void) #endif #ifdef CDC_ENABLED - SerialUSB.begin(115200); + SERIAL_PORT_USBVIRTUAL.begin(115200); #endif } - +char testchar[10]; void loop(void) { #ifdef HID_ENABLED @@ -64,11 +68,14 @@ void loop(void) #endif #ifdef CDC_ENABLED - if (SerialUSB.available() > 0) + if (SERIAL_PORT_USBVIRTUAL.available() > 0) { char inChar; - while( -1 == (inChar = SerialUSB.read())); - SerialUSB.print(inChar); + + //while( -1 == (inChar = SERIAL_PORT_USBVIRTUAL.read())); + inChar = SERIAL_PORT_USBVIRTUAL.read(); + + SERIAL_PORT_USBVIRTUAL.print(inChar); } delay(10);