From 67e461114cacec5366ae171975e0611a97e6788c Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 23 Aug 2023 18:16:16 +0700 Subject: [PATCH] change metro s3 psram type to opi, default SD_CS (SS) to input pull up --- boards.txt | 6 ++-- variants/adafruit_metro_esp32s3/variant.cpp | 37 +++++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 variants/adafruit_metro_esp32s3/variant.cpp diff --git a/boards.txt b/boards.txt index eaa43ce2f..ccd551248 100644 --- a/boards.txt +++ b/boards.txt @@ -8360,15 +8360,15 @@ adafruit_metro_esp32s3.menu.UploadMode.default=UART0 / Hardware CDC adafruit_metro_esp32s3.menu.UploadMode.default.upload.use_1200bps_touch=false adafruit_metro_esp32s3.menu.UploadMode.default.upload.wait_for_upload_port=false +adafruit_metro_esp32s3.menu.PSRAM.opi=OPI PSRAM +adafruit_metro_esp32s3.menu.PSRAM.opi.build.defines=-DBOARD_HAS_PSRAM +adafruit_metro_esp32s3.menu.PSRAM.opi.build.psram_type=opi adafruit_metro_esp32s3.menu.PSRAM.enabled=QSPI PSRAM adafruit_metro_esp32s3.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM adafruit_metro_esp32s3.menu.PSRAM.enabled.build.psram_type=qspi adafruit_metro_esp32s3.menu.PSRAM.disabled=Disabled adafruit_metro_esp32s3.menu.PSRAM.disabled.build.defines= adafruit_metro_esp32s3.menu.PSRAM.disabled.build.psram_type=qspi -adafruit_metro_esp32s3.menu.PSRAM.opi=OPI PSRAM -adafruit_metro_esp32s3.menu.PSRAM.opi.build.defines=-DBOARD_HAS_PSRAM -adafruit_metro_esp32s3.menu.PSRAM.opi.build.psram_type=opi adafruit_metro_esp32s3.menu.PartitionScheme.tinyuf2=TinyUF2 16MB (2MB APP/11.6MB FATFS) adafruit_metro_esp32s3.menu.PartitionScheme.tinyuf2.build.custom_bootloader=bootloader-tinyuf2 diff --git a/variants/adafruit_metro_esp32s3/variant.cpp b/variants/adafruit_metro_esp32s3/variant.cpp new file mode 100644 index 000000000..811a6d508 --- /dev/null +++ b/variants/adafruit_metro_esp32s3/variant.cpp @@ -0,0 +1,37 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2021 Ha Thach (tinyusb.org) for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#include "esp32-hal-gpio.h" +#include "pins_arduino.h" + +extern "C" { + +// Initialize variant/board, called before setup() +void initVariant(void) { + // default SD_CS to input pullup + pinMode(SS, INPUT_PULLUP); +} + +}