fix functionality for RP2x hosts
This commit is contained in:
parent
05c57a9690
commit
bbd38c439e
1 changed files with 16 additions and 0 deletions
|
|
@ -109,16 +109,32 @@ void setup() {
|
||||||
digitalWrite(ESP32_RESETN, HIGH);
|
digitalWrite(ESP32_RESETN, HIGH);
|
||||||
pixel.setPixelColor(0, 20, 20, 0); pixel.show();
|
pixel.setPixelColor(0, 20, 20, 0); pixel.show();
|
||||||
delay(100);
|
delay(100);
|
||||||
|
|
||||||
|
#if defined(LED_BUILTIN)
|
||||||
|
pinMode(LED_BUILTIN, OUTPUT);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
while (Serial.available()) {
|
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();
|
pixel.setPixelColor(0, 10, 0, 0); pixel.show();
|
||||||
|
#endif
|
||||||
SerialESP32.write(Serial.read());
|
SerialESP32.write(Serial.read());
|
||||||
}
|
}
|
||||||
|
|
||||||
while (SerialESP32.available()) {
|
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();
|
pixel.setPixelColor(0, 0, 0, 10); pixel.show();
|
||||||
|
#endif
|
||||||
Serial.write(SerialESP32.read());
|
Serial.write(SerialESP32.read());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue