From bbd38c439e54ea8295bc87d8c34eb5947d7dfffc Mon Sep 17 00:00:00 2001 From: ladyada Date: Sun, 1 Jun 2025 15:21:50 -0400 Subject: [PATCH] fix functionality for RP2x hosts --- .../SerialESPPassthrough.ino | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Adafruit_ESP32_Arduino_Demos/SerialESPPassthrough/SerialESPPassthrough.ino b/Adafruit_ESP32_Arduino_Demos/SerialESPPassthrough/SerialESPPassthrough.ino index a8e9d91bb..f6fd2a323 100644 --- a/Adafruit_ESP32_Arduino_Demos/SerialESPPassthrough/SerialESPPassthrough.ino +++ b/Adafruit_ESP32_Arduino_Demos/SerialESPPassthrough/SerialESPPassthrough.ino @@ -109,16 +109,32 @@ void setup() { digitalWrite(ESP32_RESETN, HIGH); pixel.setPixelColor(0, 20, 20, 0); pixel.show(); delay(100); + +#if defined(LED_BUILTIN) + pinMode(LED_BUILTIN, OUTPUT); +#endif } void loop() { while (Serial.available()) { +#if defined(ARDUINO_ARCH_RP2040) // Neopixel is blocking and this annoys esptool + #if defined(LED_BUILTIN) + digitalWrite(LED_BUILTIN, HIGH); + #endif +#else pixel.setPixelColor(0, 10, 0, 0); pixel.show(); +#endif SerialESP32.write(Serial.read()); } while (SerialESP32.available()) { +#if defined(ARDUINO_ARCH_RP2040) // Neopixel is blocking and this annoys esptool + #if defined(LED_BUILTIN) + digitalWrite(LED_BUILTIN, LOW); + #endif +#else pixel.setPixelColor(0, 0, 0, 10); pixel.show(); +#endif Serial.write(SerialESP32.read()); } }