summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Smith <stephane.smith@titansensor.com>2022-04-13 17:25:29 +0000
committerDamien George <damien@micropython.org>2022-04-14 16:14:13 +1000
commit700535409908687633237e895f3629cb1a419c64 (patch)
tree5d1364dcd799e9811bf279de92cbbeae1d803957
parentae3d5289a5fa893ed9fd9c6d824043d7644179d7 (diff)
esp32/machine_pin: Don't expose pins 33-37 when octal SPIRAM is enabled.
For ESP32-S3 configurations, CONFIG_SPIRAM_MODE_OCT requires pins 33-37 for PSRAM. So exclude them from the machine_pin_type and machine_pin_irq_type object tables.
-rw-r--r--ports/esp32/machine_pin.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ports/esp32/machine_pin.c b/ports/esp32/machine_pin.c
index c22eb5d84..edfa4d5ca 100644
--- a/ports/esp32/machine_pin.c
+++ b/ports/esp32/machine_pin.c
@@ -191,11 +191,19 @@ STATIC const machine_pin_obj_t machine_pin_obj[] = {
{{NULL}, -1}, // 30 FLASH/PSRAM
{{NULL}, -1}, // 31 FLASH/PSRAM
{{NULL}, -1}, // 32 FLASH/PSRAM
+ #if CONFIG_SPIRAM_MODE_OCT
+ {{NULL}, -1}, // 33 FLASH/PSRAM
+ {{NULL}, -1}, // 34 FLASH/PSRAM
+ {{NULL}, -1}, // 35 FLASH/PSRAM
+ {{NULL}, -1}, // 36 FLASH/PSRAM
+ {{NULL}, -1}, // 37 FLASH/PSRAM
+ #else
{{&machine_pin_type}, GPIO_NUM_33},
{{&machine_pin_type}, GPIO_NUM_34},
{{&machine_pin_type}, GPIO_NUM_35},
{{&machine_pin_type}, GPIO_NUM_36},
{{&machine_pin_type}, GPIO_NUM_37},
+ #endif
{{&machine_pin_type}, GPIO_NUM_38},
{{&machine_pin_type}, GPIO_NUM_39}, // MTCLK
{{&machine_pin_type}, GPIO_NUM_40}, // MTDO
@@ -658,11 +666,19 @@ STATIC const machine_pin_irq_obj_t machine_pin_irq_object[] = {
{{NULL}, -1}, // 30 FLASH/PSRAM
{{NULL}, -1}, // 31 FLASH/PSRAM
{{NULL}, -1}, // 32 FLASH/PSRAM
+ #if CONFIG_SPIRAM_MODE_OCT
+ {{NULL}, -1}, // 33 FLASH/PSRAM
+ {{NULL}, -1}, // 34 FLASH/PSRAM
+ {{NULL}, -1}, // 35 FLASH/PSRAM
+ {{NULL}, -1}, // 36 FLASH/PSRAM
+ {{NULL}, -1}, // 37 FLASH/PSRAM
+ #else
{{&machine_pin_irq_type}, GPIO_NUM_33},
{{&machine_pin_irq_type}, GPIO_NUM_34},
{{&machine_pin_irq_type}, GPIO_NUM_35},
{{&machine_pin_irq_type}, GPIO_NUM_36},
{{&machine_pin_irq_type}, GPIO_NUM_37},
+ #endif
{{&machine_pin_irq_type}, GPIO_NUM_38},
{{&machine_pin_irq_type}, GPIO_NUM_39},
{{&machine_pin_irq_type}, GPIO_NUM_40},