Skip to content
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

PSRAM pins in ESP32 are now reserved only if needed #2022

Merged
merged 2 commits into from
Sep 6, 2021
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,15 @@ bool CPU_GPIO_Initialize()
// Make sure all pins are not reserved
memset(pinReserved, 0, sizeof(pinReserved));

// Reserve Pins 6-11 as used by Spi flash
for (int pinNumber = 6; pinNumber <= 11; pinNumber++)
CPU_GPIO_ReservePin(pinNumber, true);
// check if PSRAM it's available (querying largets free block available with SPIRAM capabilities)
if (heap_caps_get_largest_free_block(MALLOC_CAP_8BIT | MALLOC_CAP_32BIT | MALLOC_CAP_SPIRAM))
{
// Reserve Pins 6-11 as used by Spi flash
for (int pinNumber = 6; pinNumber <= 11; pinNumber++)
{
CPU_GPIO_ReservePin(pinNumber, true);
}
}

// Install ISR service for GPIO
esp_err_t ret = gpio_install_isr_service(0);
Expand Down