mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-11 21:47:16 +02:00
fix ESP32-S3
This commit is contained in:
parent
dc15aae48d
commit
9d8ef19290
5 changed files with 24 additions and 3 deletions
|
@ -28,9 +28,10 @@ def applyPatch(libName, patchFile):
|
|||
# list of patches to apply (relative to /src)
|
||||
applyPatch("ESPAsyncWebServer-esphome", "../patches/AsyncWeb_Prometheus.patch")
|
||||
|
||||
if env['PIOENV'][:13] == "opendtufusion":
|
||||
applyPatch("GxEPD2", "../patches/GxEPD2_SW_SPI.patch")
|
||||
elif env['PIOENV'][:5] == "esp32":
|
||||
#if env['PIOENV'][:13] == "opendtufusion":
|
||||
#applyPatch("GxEPD2", "../patches/GxEPD2_SW_SPI.patch")
|
||||
#el
|
||||
if (env['PIOENV'][:5] == "esp32") or (env['PIOENV'][:13] == "opendtufusion"):
|
||||
applyPatch("GxEPD2", "../patches/GxEPD2_HAL.patch")
|
||||
|
||||
if (env['PIOENV'][:13] == "opendtufusion") or (env['PIOENV'][:5] == "esp32"):
|
||||
|
|
|
@ -39,7 +39,12 @@ class nrfHal: public RF24_hal, public SpiPatcherHandle {
|
|||
mPinEn = static_cast<gpio_num_t>(en);
|
||||
mSpiSpeed = speed;
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
mHostDevice = SPI2_HOST;
|
||||
#else
|
||||
mHostDevice = (14 == sclk) ? SPI2_HOST : SPI3_HOST;
|
||||
#endif
|
||||
|
||||
mSpiPatcher = SpiPatcher::getInstance(mHostDevice);
|
||||
|
||||
gpio_reset_pin(mPinMosi);
|
||||
|
|
|
@ -37,7 +37,12 @@ class cmtHal : public SpiPatcherHandle {
|
|||
mPinFcs = static_cast<gpio_num_t>(fcs);
|
||||
mSpiSpeed = speed;
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
mHostDevice = SPI2_HOST;
|
||||
#else
|
||||
mHostDevice = (14 == clk) ? SPI2_HOST : SPI3_HOST;
|
||||
#endif
|
||||
|
||||
mSpiPatcher = SpiPatcher::getInstance(mHostDevice);
|
||||
|
||||
gpio_reset_pin(mPinSdio);
|
||||
|
|
|
@ -44,7 +44,12 @@ class AhoyEthernetSpi {
|
|||
gpio_reset_pin(static_cast<gpio_num_t>(pin_int));
|
||||
gpio_set_pull_mode(static_cast<gpio_num_t>(pin_int), GPIO_PULLUP_ONLY);
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
mHostDevice = SPI3_HOST;
|
||||
#else
|
||||
mHostDevice = (14 == pin_sclk) ? SPI2_HOST : SPI3_HOST;
|
||||
#endif
|
||||
|
||||
mSpiPatcher = SpiPatcher::getInstance(mHostDevice);
|
||||
|
||||
spi_device_interface_config_t devcfg = {
|
||||
|
|
|
@ -38,7 +38,12 @@ class epdHal: public GxEPD2_HalInterface, public SpiPatcherHandle {
|
|||
mPinBusy = static_cast<gpio_num_t>(busy);
|
||||
mSpiSpeed = speed;
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
mHostDevice = SPI3_HOST;
|
||||
#else
|
||||
mHostDevice = (14 == sclk) ? SPI2_HOST : SPI3_HOST;
|
||||
#endif
|
||||
|
||||
mSpiPatcher = SpiPatcher::getInstance(mHostDevice);
|
||||
|
||||
gpio_reset_pin(mPinMosi);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue