1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

Check ESP8285 at runtime (#8604)

* esp_is_8285() at runtime
* less code with less statics, just read again
This commit is contained in:
Max Prokhorov
2022-06-25 23:23:45 +03:00
committed by GitHub
parent 8decdc380a
commit 5d4ae86565
3 changed files with 34 additions and 5 deletions

View File

@ -30,7 +30,10 @@
#define NUM_DIGITAL_PINS 17
#define NUM_ANALOG_INPUTS 1
#define isFlashInterfacePin(p) ((p) >= 6 && (p) <= 11)
#define isFlashInterfacePin(p)\
(esp_is_8285()\
? ((p) == 6 || (p) == 7 || (p) == 8 || (p) == 11)\
: ((p) >= 6 && (p) <= 11))
#define analogInputToDigitalPin(p) ((p > 0) ? NOT_A_PIN : 0)
#define digitalPinToInterrupt(p) (((p) < EXTERNAL_NUM_INTERRUPTS)? (p) : NOT_AN_INTERRUPT)