Skip to content

Commit

Permalink
fix ESP32 crash when using SoftwareSerial as transmitter only (RxPin=…
Browse files Browse the repository at this point in the history
…-1) (#235)
  • Loading branch information
Jueff authored Apr 9, 2022
1 parent eb4b290 commit d6af416
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SoftwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ bool SoftwareSerial::isValidGPIOpin(int8_t pin) {
// Pinout https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/_images/esp32-c3-devkitm-1-v1-pinout.jpg
return (pin >= 0 && pin <= 1) || (pin >= 3 && pin <= 7) || (pin >= 18 && pin <= 21);
#else
return true;
return pin >= 0;
#endif
#else
return true;
return pin >= 0;
#endif
}

Expand Down

0 comments on commit d6af416

Please sign in to comment.