File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
cores/validation/validation_usb_device Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 2727
2828void 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 ];
4549void 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 );
You can’t perform that action at this time.
0 commit comments