mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
check valid pins for board_profile and analog
This commit is contained in:
@@ -420,9 +420,10 @@ void System::wifi_tweak() {
|
||||
// we allow 0 as it has a special function on the NodeMCU apparently
|
||||
// See https://diyprojects.io/esp32-how-to-use-gpio-digital-io-arduino-code/#.YFpVEq9KhjG
|
||||
// and https://nodemcu.readthedocs.io/en/dev-esp32/modules/gpio/
|
||||
bool System::is_valid_gpio(uint8_t pin) {
|
||||
bool System::is_valid_gpio(uint8_t pin, bool has_psram) {
|
||||
#if CONFIG_IDF_TARGET_ESP32 || EMSESP_STANDALONE
|
||||
if ((pin == 1) || (pin >= 6 && pin <= 11) || (pin == 20) || (pin == 24) || (pin >= 28 && pin <= 31) || (pin > 40)) {
|
||||
if ((pin == 1) || (pin >= 6 && pin <= 11) || (pin == 20) || (pin == 24) || (pin >= 28 && pin <= 31) || (pin > 40)
|
||||
|| ((EMSESP::system_.PSram() > 0 || has_psram) && pin >= 16 && pin <= 17)) {
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
if ((pin >= 19 && pin <= 20) || (pin >= 22 && pin <= 32) || (pin > 40)) {
|
||||
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||
|
||||
Reference in New Issue
Block a user