diff options
| author | Stephane Smith <stephane.smith@titansensor.com> | 2022-04-13 17:34:09 +0000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-04-14 16:17:52 +1000 |
| commit | 988827b85a9b09f1164e101ea2520562dd31634e (patch) | |
| tree | f66c651195d186b2121560cf57fcf0e463d8df87 | |
| parent | 700535409908687633237e895f3629cb1a419c64 (diff) | |
esp32/modesp32: Properly define RTC_VALID_EXT_PINS on S2/S3 variants.
On ESP32 S2/S3 variants, GPIO0 through GPIO21 are valid RTC pins. This
commit defines the valid RTC_VALID_EXT_PINS for the S2/S3 variants,
otherwise, it keeps functionality the same.
| -rw-r--r-- | ports/esp32/modesp32.h | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/ports/esp32/modesp32.h b/ports/esp32/modesp32.h index d76b3a49a..a685b7b38 100644 --- a/ports/esp32/modesp32.h +++ b/ports/esp32/modesp32.h @@ -1,7 +1,38 @@ #ifndef MICROPY_INCLUDED_ESP32_MODESP32_H #define MICROPY_INCLUDED_ESP32_MODESP32_H -#define RTC_VALID_EXT_PINS \ +#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 + + #define RTC_VALID_EXT_PINS \ + ( \ + (1ll << 0) | \ + (1ll << 1) | \ + (1ll << 2) | \ + (1ll << 3) | \ + (1ll << 4) | \ + (1ll << 5) | \ + (1ll << 6) | \ + (1ll << 7) | \ + (1ll << 8) | \ + (1ll << 9) | \ + (1ll << 10) | \ + (1ll << 11) | \ + (1ll << 12) | \ + (1ll << 13) | \ + (1ll << 14) | \ + (1ll << 15) | \ + (1ll << 16) | \ + (1ll << 17) | \ + (1ll << 18) | \ + (1ll << 19) | \ + (1ll << 20) | \ + (1ll << 21) \ + ) + #define RTC_LAST_EXT_PIN 21 + +#else + + #define RTC_VALID_EXT_PINS \ ( \ (1ll << 0) | \ (1ll << 2) | \ @@ -22,8 +53,10 @@ (1ll << 38) | \ (1ll << 39) \ ) + #define RTC_LAST_EXT_PIN 39 + +#endif -#define RTC_LAST_EXT_PIN 39 #define RTC_IS_VALID_EXT_PIN(pin_id) ((1ll << (pin_id)) & RTC_VALID_EXT_PINS) extern int8_t esp32_rmt_bitstream_channel_id; |
