Skip to content

fix(component): Do not undefine PSRAM in ESP-IDF #10502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,150 changes: 575 additions & 575 deletions boards.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cores/esp32/WString.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class String {
unsigned char len : 7; // Ensure only one byte is allocated by GCC for the bitfields
unsigned char isSSO : 1;
} __attribute__((packed)); // Ensure that GCC doesn't expand the flag byte to a 32-bit word for alignment issues
#ifdef BOARD_HAS_PSRAM
#if BOARD_HAS_PSRAM
enum {
CAPACITY_MAX = 3145728
};
Expand Down
8 changes: 7 additions & 1 deletion cores/esp32/esp32-hal-psram.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,19 @@ extern "C" {

#include "sdkconfig.h"

#ifndef BOARD_HAS_PSRAM
#if defined(BOARD_HAS_PSRAM) && BOARD_HAS_PSRAM == 0 // Arduino Build with PSRAM Off
#ifdef CONFIG_SPIRAM_SUPPORT
#undef CONFIG_SPIRAM_SUPPORT
#endif
#ifdef CONFIG_SPIRAM
#undef CONFIG_SPIRAM
#endif
#elif !defined(BOARD_HAS_PSRAM) // ESP-IDF Build with undefined BOARD_HAS_PSRAM
#if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM
#define BOARD_HAS_PSRAM 1
#else
#define BOARD_HAS_PSRAM 0
#endif
#endif

bool psramInit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#endif

// Face Detection will not work on boards without (or with disabled) PSRAM
#ifdef BOARD_HAS_PSRAM
#if BOARD_HAS_PSRAM
// Face Recognition takes upward from 15 seconds per frame on chips other than ESP32S3
// Makes no sense to have it enabled for them
#if CONFIG_IDF_TARGET_ESP32S3
Expand Down
2 changes: 1 addition & 1 deletion platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ build.bootloader_addr=0x1000
build.custom_bootloader=bootloader
build.custom_partitions=partitions
build.code_debug=0
build.defines=
build.defines=-DBOARD_HAS_PSRAM=0
build.loop_core=
build.event_core=
build.extra_flags=-DARDUINO_HOST_OS="{runtime.os}" -DARDUINO_FQBN="{build.fqbn}" -DESP32=ESP32 -DCORE_DEBUG_LEVEL={build.code_debug} {build.loop_core} {build.event_core} {build.defines} {build.extra_flags.{build.mcu}} {build.zigbee_mode}
Expand Down
4 changes: 2 additions & 2 deletions variants/esp32-poe-iso/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define ETH_PHY_MDC 23
#define ETH_PHY_MDIO 18
#define ETH_PHY_POWER 12
#if defined BOARD_HAS_PSRAM // when PSRAM is enabled pins 16 and 17 are used for the PSRAM and alternative pins are used for respectively I2C SCL and Ethernet Clock GPIO
#if BOARD_HAS_PSRAM // when PSRAM is enabled pins 16 and 17 are used for the PSRAM and alternative pins are used for respectively I2C SCL and Ethernet Clock GPIO
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_OUT
#else
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
Expand All @@ -26,7 +26,7 @@ static const uint8_t RX = 3;
#define RX2 35 // ext2 pin 3

static const uint8_t SDA = 13;
#if defined BOARD_HAS_PSRAM // when PSRAM is enabled pins 16 and 17 are used for the PSRAM and alternative pins are used for respectively I2C SCL and Ethernet Clock GPIO
#if BOARD_HAS_PSRAM // when PSRAM is enabled pins 16 and 17 are used for the PSRAM and alternative pins are used for respectively I2C SCL and Ethernet Clock GPIO
static const uint8_t SCL = 33;
#else
static const uint8_t SCL = 16;
Expand Down
4 changes: 2 additions & 2 deletions variants/esp32-poe/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define ETH_PHY_MDC 23
#define ETH_PHY_MDIO 18
#define ETH_PHY_POWER 12
#if defined BOARD_HAS_PSRAM // when PSRAM is enabled pins 16 and 17 are used for the PSRAM and alternative pins are used for respectively I2C SCL and Ethernet Clock GPIO
#if BOARD_HAS_PSRAM // when PSRAM is enabled pins 16 and 17 are used for the PSRAM and alternative pins are used for respectively I2C SCL and Ethernet Clock GPIO
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_OUT
#else
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
Expand All @@ -26,7 +26,7 @@ static const uint8_t RX = 3;
#define RX2 35 // ext2 pin 3

static const uint8_t SDA = 13;
#if defined BOARD_HAS_PSRAM // when PSRAM is enabled pins 16 and 17 are used for the PSRAM and alternative pins are used for respectively I2C SCL and Ethernet Clock GPIO
#if BOARD_HAS_PSRAM // when PSRAM is enabled pins 16 and 17 are used for the PSRAM and alternative pins are used for respectively I2C SCL and Ethernet Clock GPIO
static const uint8_t SCL = 33;
#else
static const uint8_t SCL = 16;
Expand Down
Loading