Skip to content

Commit 988827b

Browse files
stephanelsmithdpgeorge
authored andcommitted
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.
1 parent 7005354 commit 988827b

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

Diff for: ports/esp32/modesp32.h

+35-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,38 @@
11
#ifndef MICROPY_INCLUDED_ESP32_MODESP32_H
22
#define MICROPY_INCLUDED_ESP32_MODESP32_H
33

4-
#define RTC_VALID_EXT_PINS \
4+
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
5+
6+
#define RTC_VALID_EXT_PINS \
7+
( \
8+
(1ll << 0) | \
9+
(1ll << 1) | \
10+
(1ll << 2) | \
11+
(1ll << 3) | \
12+
(1ll << 4) | \
13+
(1ll << 5) | \
14+
(1ll << 6) | \
15+
(1ll << 7) | \
16+
(1ll << 8) | \
17+
(1ll << 9) | \
18+
(1ll << 10) | \
19+
(1ll << 11) | \
20+
(1ll << 12) | \
21+
(1ll << 13) | \
22+
(1ll << 14) | \
23+
(1ll << 15) | \
24+
(1ll << 16) | \
25+
(1ll << 17) | \
26+
(1ll << 18) | \
27+
(1ll << 19) | \
28+
(1ll << 20) | \
29+
(1ll << 21) \
30+
)
31+
#define RTC_LAST_EXT_PIN 21
32+
33+
#else
34+
35+
#define RTC_VALID_EXT_PINS \
536
( \
637
(1ll << 0) | \
738
(1ll << 2) | \
@@ -22,8 +53,10 @@
2253
(1ll << 38) | \
2354
(1ll << 39) \
2455
)
56+
#define RTC_LAST_EXT_PIN 39
57+
58+
#endif
2559

26-
#define RTC_LAST_EXT_PIN 39
2760
#define RTC_IS_VALID_EXT_PIN(pin_id) ((1ll << (pin_id)) & RTC_VALID_EXT_PINS)
2861

2962
extern int8_t esp32_rmt_bitstream_channel_id;

0 commit comments

Comments
 (0)