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 27
27
28
28
void setup (void )
29
29
{
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
+
30
34
#ifdef HID_ENABLED
31
35
Mouse.begin ();
32
36
@@ -37,11 +41,11 @@ void setup(void)
37
41
#endif
38
42
39
43
#ifdef CDC_ENABLED
40
- SerialUSB .begin (115200 );
44
+ SERIAL_PORT_USBVIRTUAL .begin (115200 );
41
45
#endif
42
46
}
43
47
44
-
48
+ char testchar[ 10 ];
45
49
void loop (void )
46
50
{
47
51
#ifdef HID_ENABLED
@@ -64,11 +68,14 @@ void loop(void)
64
68
#endif
65
69
66
70
#ifdef CDC_ENABLED
67
- if (SerialUSB .available () > 0 )
71
+ if (SERIAL_PORT_USBVIRTUAL .available () > 0 )
68
72
{
69
73
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);
72
79
}
73
80
74
81
delay (10 );
You can’t perform that action at this time.
0 commit comments