Skip to content

Commit f5957e6

Browse files
committed
Update/add comments explaining the purpose of while(!Serial) in examples
The previous comments (where they existed) only mentioned Leonardo but there are other boards with native USB. Fixes a regression of an issue previously reported/fixed at arduino/Arduino#3786, and expands it to the other two Language Reference pages that use while(!Serial) in their examples.
1 parent 32794d3 commit f5957e6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Language/Functions/Communication/Serial/ifSerial.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void setup() {
6868
//Initialize serial and wait for port to open:
6969
Serial.begin(9600);
7070
while (!Serial) {
71-
; // wait for serial port to connect. Needed for Leonardo only
71+
; // wait for serial port to connect. Needed for native USB
7272
}
7373
}
7474

Language/Variables/Data Types/String/Functions/reserve.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void setup() {
5656
// initialize serial and wait for port to open:
5757
Serial.begin(9600);
5858
while (!Serial) {
59-
; // wait for serial port to connect. Needed for Leonardo only
59+
; // wait for serial port to connect. Needed for native USB
6060
}
6161
6262
myString.reserve(26);

Language/Variables/Utilities/PROGMEM.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ char myChar;
7777
7878
void setup() {
7979
Serial.begin(9600);
80-
while (!Serial);
80+
while (!Serial); // wait for serial port to connect. Needed for native USB
8181
8282
// put your setup code here, to run once:
8383
// read back a 2-byte int
@@ -144,7 +144,7 @@ char buffer[30]; // make sure this is large enough for the largest string it
144144
void setup()
145145
{
146146
Serial.begin(9600);
147-
while(!Serial);
147+
while(!Serial); // wait for serial port to connect. Needed for native USB
148148
Serial.println("OK");
149149
}
150150

0 commit comments

Comments
 (0)