Skip to content

Commit 9725145

Browse files
committed
updated validation test for usb_device
1 parent d181360 commit 9725145

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

cores/validation/validation_usb_device/test_usb_device.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727

2828
void setup(void)
2929
{
30+
SERIAL_PORT_MONITOR.begin( 115200 );
31+
while (!SERIAL_PORT_MONITOR); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
32+
SERIAL_PORT_MONITOR.println("Start USB device test");
33+
3034
#ifdef HID_ENABLED
3135
Mouse.begin();
3236

@@ -37,11 +41,11 @@ void setup(void)
3741
#endif
3842

3943
#ifdef CDC_ENABLED
40-
SerialUSB.begin(115200);
44+
SERIAL_PORT_USBVIRTUAL.begin(115200);
4145
#endif
4246
}
4347

44-
48+
char testchar[10];
4549
void loop(void)
4650
{
4751
#ifdef HID_ENABLED
@@ -64,11 +68,14 @@ void loop(void)
6468
#endif
6569

6670
#ifdef CDC_ENABLED
67-
if (SerialUSB.available() > 0)
71+
if (SERIAL_PORT_USBVIRTUAL.available() > 0)
6872
{
6973
char inChar;
70-
while( -1 == (inChar = SerialUSB.read()));
71-
SerialUSB.print(inChar);
74+
75+
//while( -1 == (inChar = SERIAL_PORT_USBVIRTUAL.read()));
76+
inChar = SERIAL_PORT_USBVIRTUAL.read();
77+
78+
SERIAL_PORT_USBVIRTUAL.print(inChar);
7279
}
7380

7481
delay(10);

0 commit comments

Comments
 (0)