Skip to content

Commit

Permalink
Merge pull request espressif#10715 from SuGlider/remove_while_not_ser…
Browse files Browse the repository at this point in the history
…ial_in_examples

feat(arduino): remove all while(not serial) in examples
  • Loading branch information
me-no-dev authored Dec 11, 2024
2 parents 237523e + 029a57f commit fb6e977
Show file tree
Hide file tree
Showing 23 changed files with 11 additions and 67 deletions.
3 changes: 0 additions & 3 deletions libraries/ESP32/examples/AnalogOut/LEDCFade/LEDCFade.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ void ARDUINO_ISR_ATTR LED_FADE_ISR() {
void setup() {
// Initialize serial communication at 115200 bits per second:
Serial.begin(115200);
while (!Serial) {
delay(10);
}

// Setup timer with given frequency, resolution and attach it to a led pin with auto-selected channel
ledcAttach(LED_PIN, LEDC_BASE_FREQ, LEDC_TIMER_12_BIT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ void ulp_setup() {

void setup() {
Serial.begin(115200);
while (!Serial) {} // wait for Serial to start

ulp_setup(); // it really only runs on the first ESP32 boot
Serial.printf("\nStarted smooth blink with delay %ld\n", *fadeCycleDelay);
Expand Down
4 changes: 1 addition & 3 deletions libraries/ESP32/examples/FreeRTOS/Mutex/Mutex.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ void Task(void *pvParameters);
void setup() {
// Initialize serial communication at 115200 bits per second:
Serial.begin(115200);
while (!Serial) {
delay(100);
}

Serial.printf(" Task 0 | Task 1\n");

#ifdef USE_MUTEX
Expand Down
3 changes: 0 additions & 3 deletions libraries/ESP32/examples/FreeRTOS/Queue/Queue.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ typedef struct {
void setup() {
// Initialize serial communication at 115200 bits per second:
Serial.begin(115200);
while (!Serial) {
delay(10);
}

// Create the queue which will have <QueueElementSize> number of elements, each of size `message_t` and pass the address to <QueueHandle>.
QueueHandle = xQueueCreate(QueueElementSize, sizeof(message_t));
Expand Down
4 changes: 1 addition & 3 deletions libraries/ESP32/examples/FreeRTOS/Semaphore/Semaphore.ino
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ void warehouse_worker_task(void *pvParameters) {

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(100);
}

// Create the semaphore
package_delivered_semaphore = xSemaphoreCreateCounting(10, 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ Button button2(BUTTON2);

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}

Serial.println("Starting Functional Interrupt example.");
button1.begin();
button2.begin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ esp_mac_type_t values:
void setup() {

Serial.begin(115200);
while (!Serial) {
delay(100);
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}

RS485.begin(9600, SERIAL_8N1, RS485_RX_PIN, RS485_TX_PIN);
while (!RS485) {
Expand Down
4 changes: 1 addition & 3 deletions libraries/ESP32/examples/Utilities/HEXBuilder/HEXBuilder.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}

Serial.println("\n\n\nStart.");

// Convert a HEX string like 6c6c6f20576f726c64 to a binary buffer
Expand Down
4 changes: 1 addition & 3 deletions libraries/ESP32/examples/Utilities/MD5Builder/MD5Builder.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}

Serial.println("\n\n\nStart.");

// Check if a password obfuscated in an MD5 actually
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}

Serial.println("\n\n\nStart.");

// Check if a password obfuscated in an SHA1 actually
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ void setup() {

// Initialize the serial port
Serial.begin(115200);
while (!Serial) {
delay(10);
}

pinMode(PA_ENABLE, OUTPUT);
digitalWrite(PA_ENABLE, HIGH);
Expand Down
3 changes: 0 additions & 3 deletions libraries/ESP_I2S/examples/Record_to_WAV/Record_to_WAV.ino
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ void setup() {

// Initialize the serial port
Serial.begin(115200);
while (!Serial) {
delay(10);
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ ESP_NOW_Broadcast_Peer broadcast_peer(ESPNOW_WIFI_CHANNEL, WIFI_IF_STA, NULL);

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}

// Initialize the Wi-Fi module
WiFi.mode(WIFI_STA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ void register_new_master(const esp_now_recv_info_t *info, const uint8_t *data, i

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}

// Initialize the Wi-Fi module
WiFi.mode(WIFI_STA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,6 @@ void setup() {
uint8_t self_mac[6];

Serial.begin(115200);
while (!Serial) {
delay(10);
}

// Initialize the Wi-Fi module
WiFi.mode(WIFI_STA);
Expand Down
3 changes: 0 additions & 3 deletions libraries/SD/examples/SD_Test/SD_Test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@ void testFileIO(fs::FS &fs, const char *path) {

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}

#ifdef REASSIGN_PINS
SPI.begin(sck, miso, mosi, cs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ String *credentialsHandler(HTTPAuthMethod mode, String username, String params[]

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}

WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ credentials_t passwdfile[] = {{"admin", "esp32"}, {"fred", "41234123"}, {"charli

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}

WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ const char *www_password_base64 = "jLEk+MJ3wW7Asu4AVp/RUaCONCs=";

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}

WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ String *check_bearer_or_auth(HTTPAuthMethod mode, String authReq, String params[

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}

WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ void setup(void) {
pinMode(led, OUTPUT);
digitalWrite(led, 0);
Serial.begin(115200);
while (!Serial) {
delay(100);
}

Serial.println("Multi-homed Servers example starting");
delay(1000);
WiFi.mode(WIFI_STA);
Expand Down
3 changes: 0 additions & 3 deletions libraries/WiFi/examples/WiFiClient/WiFiClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ int fieldNumber = 1; // Field number which will be read out

void setup() {
Serial.begin(115200);
while (!Serial) {
delay(100);
}

// We start by connecting to a WiFi network

Expand Down

0 comments on commit fb6e977

Please sign in to comment.