Skip to content

Commit fb6e977

Browse files
authored
Merge pull request #10715 from SuGlider/remove_while_not_serial_in_examples
feat(arduino): remove all while(not serial) in examples
2 parents 237523e + 029a57f commit fb6e977

File tree

23 files changed

+11
-67
lines changed

23 files changed

+11
-67
lines changed

libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino

-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ void ARDUINO_ISR_ATTR LED_FADE_ISR() {
3030
void setup() {
3131
// Initialize serial communication at 115200 bits per second:
3232
Serial.begin(115200);
33-
while (!Serial) {
34-
delay(10);
35-
}
3633

3734
// Setup timer with given frequency, resolution and attach it to a led pin with auto-selected channel
3835
ledcAttach(LED_PIN, LEDC_BASE_FREQ, LEDC_TIMER_12_BIT);

libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code/SmoothBlink_ULP_Code.ino

-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ void ulp_setup() {
139139

140140
void setup() {
141141
Serial.begin(115200);
142-
while (!Serial) {} // wait for Serial to start
143142

144143
ulp_setup(); // it really only runs on the first ESP32 boot
145144
Serial.printf("\nStarted smooth blink with delay %ld\n", *fadeCycleDelay);

libraries/ESP32/examples/FreeRTOS/Mutex/Mutex.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ void Task(void *pvParameters);
1717
void setup() {
1818
// Initialize serial communication at 115200 bits per second:
1919
Serial.begin(115200);
20-
while (!Serial) {
21-
delay(100);
22-
}
20+
2321
Serial.printf(" Task 0 | Task 1\n");
2422

2523
#ifdef USE_MUTEX

libraries/ESP32/examples/FreeRTOS/Queue/Queue.ino

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ typedef struct {
2424
void setup() {
2525
// Initialize serial communication at 115200 bits per second:
2626
Serial.begin(115200);
27-
while (!Serial) {
28-
delay(10);
29-
}
3027

3128
// Create the queue which will have <QueueElementSize> number of elements, each of size `message_t` and pass the address to <QueueHandle>.
3229
QueueHandle = xQueueCreate(QueueElementSize, sizeof(message_t));

libraries/ESP32/examples/FreeRTOS/Semaphore/Semaphore.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ void warehouse_worker_task(void *pvParameters) {
3636

3737
void setup() {
3838
Serial.begin(115200);
39-
while (!Serial) {
40-
delay(100);
41-
}
39+
4240
// Create the semaphore
4341
package_delivered_semaphore = xSemaphoreCreateCounting(10, 0);
4442

libraries/ESP32/examples/GPIO/FunctionalInterrupt/FunctionalInterrupt.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ Button button2(BUTTON2);
5656

5757
void setup() {
5858
Serial.begin(115200);
59-
while (!Serial) {
60-
delay(10);
61-
}
59+
6260
Serial.println("Starting Functional Interrupt example.");
6361
button1.begin();
6462
button2.begin();

libraries/ESP32/examples/MacAddress/GetMacAddress/GetMacAddress.ino

-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ esp_mac_type_t values:
3434
void setup() {
3535

3636
Serial.begin(115200);
37-
while (!Serial) {
38-
delay(100);
39-
}
4037

4138
Serial.println("Interface\t\t\t\t\t\tMAC address (6 bytes, 4 universally administered, default)");
4239

libraries/ESP32/examples/Serial/RS485_Echo_Demo/RS485_Echo_Demo.ino

-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121

2222
void setup() {
2323
Serial.begin(115200);
24-
while (!Serial) {
25-
delay(10);
26-
}
2724

2825
RS485.begin(9600, SERIAL_8N1, RS485_RX_PIN, RS485_TX_PIN);
2926
while (!RS485) {

libraries/ESP32/examples/Utilities/HEXBuilder/HEXBuilder.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
void setup() {
44
Serial.begin(115200);
5-
while (!Serial) {
6-
delay(10);
7-
}
5+
86
Serial.println("\n\n\nStart.");
97

108
// Convert a HEX string like 6c6c6f20576f726c64 to a binary buffer

libraries/ESP32/examples/Utilities/MD5Builder/MD5Builder.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212

1313
void setup() {
1414
Serial.begin(115200);
15-
while (!Serial) {
16-
delay(10);
17-
}
15+
1816
Serial.println("\n\n\nStart.");
1917

2018
// Check if a password obfuscated in an MD5 actually

libraries/ESP32/examples/Utilities/SHA1Builder/SHA1Builder.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313

1414
void setup() {
1515
Serial.begin(115200);
16-
while (!Serial) {
17-
delay(10);
18-
}
16+
1917
Serial.println("\n\n\nStart.");
2018

2119
// Check if a password obfuscated in an SHA1 actually

libraries/ESP_I2S/examples/ES8388_loopback/ES8388_loopback.ino

-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ void setup() {
4040

4141
// Initialize the serial port
4242
Serial.begin(115200);
43-
while (!Serial) {
44-
delay(10);
45-
}
4643

4744
pinMode(PA_ENABLE, OUTPUT);
4845
digitalWrite(PA_ENABLE, HIGH);

libraries/ESP_I2S/examples/Record_to_WAV/Record_to_WAV.ino

-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ void setup() {
3232

3333
// Initialize the serial port
3434
Serial.begin(115200);
35-
while (!Serial) {
36-
delay(10);
37-
}
3835

3936
Serial.println("Initializing I2S bus...");
4037

libraries/ESP_NOW/examples/ESP_NOW_Broadcast_Master/ESP_NOW_Broadcast_Master.ino

-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ ESP_NOW_Broadcast_Peer broadcast_peer(ESPNOW_WIFI_CHANNEL, WIFI_IF_STA, NULL);
6464

6565
void setup() {
6666
Serial.begin(115200);
67-
while (!Serial) {
68-
delay(10);
69-
}
7067

7168
// Initialize the Wi-Fi module
7269
WiFi.mode(WIFI_STA);

libraries/ESP_NOW/examples/ESP_NOW_Broadcast_Slave/ESP_NOW_Broadcast_Slave.ino

-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ void register_new_master(const esp_now_recv_info_t *info, const uint8_t *data, i
8080

8181
void setup() {
8282
Serial.begin(115200);
83-
while (!Serial) {
84-
delay(10);
85-
}
8683

8784
// Initialize the Wi-Fi module
8885
WiFi.mode(WIFI_STA);

libraries/ESP_NOW/examples/ESP_NOW_Network/ESP_NOW_Network.ino

-3
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,6 @@ void setup() {
248248
uint8_t self_mac[6];
249249

250250
Serial.begin(115200);
251-
while (!Serial) {
252-
delay(10);
253-
}
254251

255252
// Initialize the Wi-Fi module
256253
WiFi.mode(WIFI_STA);

libraries/SD/examples/SD_Test/SD_Test.ino

-3
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,6 @@ void testFileIO(fs::FS &fs, const char *path) {
209209

210210
void setup() {
211211
Serial.begin(115200);
212-
while (!Serial) {
213-
delay(10);
214-
}
215212

216213
#ifdef REASSIGN_PINS
217214
SPI.begin(sck, miso, mosi, cs);

libraries/WebServer/examples/HttpAuthCallback/HttpAuthCallback.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ String *credentialsHandler(HTTPAuthMethod mode, String username, String params[]
2929

3030
void setup() {
3131
Serial.begin(115200);
32-
while (!Serial) {
33-
delay(10);
34-
}
32+
3533
WiFi.mode(WIFI_STA);
3634
WiFi.begin(ssid, password);
3735
if (WiFi.waitForConnectResult() != WL_CONNECTED) {

libraries/WebServer/examples/HttpAuthCallbackInline/HttpAuthCallbackInline.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ credentials_t passwdfile[] = {{"admin", "esp32"}, {"fred", "41234123"}, {"charli
1717

1818
void setup() {
1919
Serial.begin(115200);
20-
while (!Serial) {
21-
delay(10);
22-
}
20+
2321
WiFi.mode(WIFI_STA);
2422
WiFi.begin(ssid, password);
2523
if (WiFi.waitForConnectResult() != WL_CONNECTED) {

libraries/WebServer/examples/HttpBasicAuthSHA1/HttpBasicAuthSHA1.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ const char *www_password_base64 = "jLEk+MJ3wW7Asu4AVp/RUaCONCs=";
3131

3232
void setup() {
3333
Serial.begin(115200);
34-
while (!Serial) {
35-
delay(10);
36-
}
34+
3735
WiFi.mode(WIFI_STA);
3836
WiFi.begin(ssid, password);
3937
if (WiFi.waitForConnectResult() != WL_CONNECTED) {

libraries/WebServer/examples/HttpBasicAuthSHA1orBearerToken/HttpBasicAuthSHA1orBearerToken.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ String *check_bearer_or_auth(HTTPAuthMethod mode, String authReq, String params[
7878

7979
void setup() {
8080
Serial.begin(115200);
81-
while (!Serial) {
82-
delay(10);
83-
}
81+
8482
WiFi.mode(WIFI_STA);
8583
WiFi.begin(ssid, password);
8684
if (WiFi.waitForConnectResult() != WL_CONNECTED) {

libraries/WebServer/examples/MultiHomedServers/MultiHomedServers.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ void setup(void) {
6666
pinMode(led, OUTPUT);
6767
digitalWrite(led, 0);
6868
Serial.begin(115200);
69-
while (!Serial) {
70-
delay(100);
71-
}
69+
7270
Serial.println("Multi-homed Servers example starting");
7371
delay(1000);
7472
WiFi.mode(WIFI_STA);

libraries/WiFi/examples/WiFiClient/WiFiClient.ino

-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ int fieldNumber = 1; // Field number which will be read out
3434

3535
void setup() {
3636
Serial.begin(115200);
37-
while (!Serial) {
38-
delay(100);
39-
}
4037

4138
// We start by connecting to a WiFi network
4239

0 commit comments

Comments
 (0)