mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-16 16:41:33 +10:00
preliminary workaround setLDOPower() crash
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#include "variant.h"
|
||||
#include "Arduino.h"
|
||||
#include <esp32-hal-periman.h>
|
||||
|
||||
void earlyInitVariant()
|
||||
{
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32P4) && defined(BOARD_SDMMC_POWER_PIN)
|
||||
// Work around Arduino-ESP32 P4 SPI null-deref in setLDOPower() when this pin
|
||||
// already has a bus type but no extra type string assigned.
|
||||
if (perimanPinIsValid(BOARD_SDMMC_POWER_PIN) && perimanGetPinBusType(BOARD_SDMMC_POWER_PIN) != ESP32_BUS_TYPE_MAX &&
|
||||
perimanGetPinBusExtraType(BOARD_SDMMC_POWER_PIN) == nullptr) {
|
||||
perimanSetPinBusExtraType(BOARD_SDMMC_POWER_PIN, "");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user