mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-15 16:01:19 +10:00
fix LDO warnings
This commit is contained in:
@@ -80,14 +80,18 @@ static const uint8_t T13 = 15;
|
||||
|
||||
#if defined(CROWPANEL_ADV_P4_50)
|
||||
#define BOARD_SDMMC_SLOT 1
|
||||
// Workaround for Arduino-ESP32 P4 SPI LDO auto-config on SDMMC slot0 pins (47/48).
|
||||
// Use a valid GPIO (aligned to variant LoRa CS) and pre-tag it in initVariant()
|
||||
// so setLDOPower() short-circuits.
|
||||
#define BOARD_SDMMC_POWER_PIN 30
|
||||
#else
|
||||
#define BOARD_SDMMC_POWER_PIN 10
|
||||
#define BOARD_SDMMC_SLOT 0
|
||||
#endif
|
||||
#define BOARD_SDMMC_POWER_CHANNEL 4
|
||||
#define BOARD_SDMMC_POWER_PIN -1
|
||||
#define BOARD_SDMMC_POWER_ON_LEVEL LOW
|
||||
#define BOARD_SDMMC_POWER_ON_LEVEL HIGH
|
||||
|
||||
// WIFI - ESP32C6 (CrowPanel Advanced P4)
|
||||
// BT/WIFI - ESP32C6
|
||||
#define BOARD_HAS_SDIO_ESP_HOSTED
|
||||
#ifdef CROWPANEL_ADV_P4_50
|
||||
// CrowPanel Advanced P4 50": 4-bit SDIO on Slot 1 with GPIO 53/54/52/51/50/49
|
||||
|
||||
@@ -2,14 +2,22 @@
|
||||
#include "Arduino.h"
|
||||
#include <esp32-hal-periman.h>
|
||||
|
||||
void earlyInitVariant()
|
||||
extern "C" void initVariant(void)
|
||||
{
|
||||
#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, "");
|
||||
// Ensure setLDOPower() exits early for this board family.
|
||||
// On ESP32-P4, Arduino SPI may attempt SDMMC on-chip LDO setup when SPI uses
|
||||
// pins that match SDMMC slot0 IOMUX pins (for example, GPIO 47/48 on p4-50).
|
||||
// Pre-tagging BOARD_SDMMC_POWER_PIN as "SDMMC POWER" short-circuits that path.
|
||||
if (perimanPinIsValid(BOARD_SDMMC_POWER_PIN)) {
|
||||
pinMode(BOARD_SDMMC_POWER_PIN, OUTPUT);
|
||||
digitalWrite(BOARD_SDMMC_POWER_PIN, BOARD_SDMMC_POWER_ON_LEVEL);
|
||||
|
||||
if (perimanGetPinBusType(BOARD_SDMMC_POWER_PIN) != ESP32_BUS_TYPE_MAX &&
|
||||
perimanGetPinBusExtraType(BOARD_SDMMC_POWER_PIN) == nullptr) {
|
||||
perimanSetPinBusExtraType(BOARD_SDMMC_POWER_PIN, "");
|
||||
}
|
||||
perimanSetPinBusExtraType(BOARD_SDMMC_POWER_PIN, "SDMMC POWER");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user