Skip to content

Commit 834f226

Browse files
authored
Merge pull request #3047 from ladyada/rp2040_esppassthru
fix functionality for RP2x hosts
2 parents f3d3405 + bbd38c4 commit 834f226

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Adafruit_ESP32_Arduino_Demos/SerialESPPassthrough/SerialESPPassthrough.ino

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,32 @@ void setup() {
109109
digitalWrite(ESP32_RESETN, HIGH);
110110
pixel.setPixelColor(0, 20, 20, 0); pixel.show();
111111
delay(100);
112+
113+
#if defined(LED_BUILTIN)
114+
pinMode(LED_BUILTIN, OUTPUT);
115+
#endif
112116
}
113117

114118
void loop() {
115119
while (Serial.available()) {
120+
#if defined(ARDUINO_ARCH_RP2040) // Neopixel is blocking and this annoys esptool
121+
#if defined(LED_BUILTIN)
122+
digitalWrite(LED_BUILTIN, HIGH);
123+
#endif
124+
#else
116125
pixel.setPixelColor(0, 10, 0, 0); pixel.show();
126+
#endif
117127
SerialESP32.write(Serial.read());
118128
}
119129

120130
while (SerialESP32.available()) {
131+
#if defined(ARDUINO_ARCH_RP2040) // Neopixel is blocking and this annoys esptool
132+
#if defined(LED_BUILTIN)
133+
digitalWrite(LED_BUILTIN, LOW);
134+
#endif
135+
#else
121136
pixel.setPixelColor(0, 0, 0, 10); pixel.show();
137+
#endif
122138
Serial.write(SerialESP32.read());
123139
}
124140
}

0 commit comments

Comments
 (0)