Skip to content

Commit

Permalink
Merge pull request #1392 from petermm/fix-p4-esp-build
Browse files Browse the repository at this point in the history
Fix esp-idf >= 5.3.2 P4 builds

5.3.2 needs extra guards for esp32-P4
espressif/esp-idf@706935f

Fixes #1387

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
  • Loading branch information
bettio committed Dec 12, 2024
2 parents 89438f3 + 771df7c commit af0f64d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/platforms/esp32/components/avm_builtins/gpio_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ static term nif_gpio_hold_dis(Context *ctx, int argc, term argv[])
return hold_dis(argv[0]);
}

#if !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 2) && SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP && !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 2) && !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP)
static term nif_gpio_deep_sleep_hold_en(Context *ctx, int argc, term argv[])
{
UNUSED(ctx);
Expand Down Expand Up @@ -769,9 +769,8 @@ static const struct Nif gpio_hold_dis_nif =
.nif_ptr = nif_gpio_hold_dis
};

#if !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP
static const struct Nif gpio_deep_sleep_hold_en_nif =
{
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 2) && SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP && !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 2) && !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP)
static const struct Nif gpio_deep_sleep_hold_en_nif = {
.base.type = NIFFunctionType,
.nif_ptr = nif_gpio_deep_sleep_hold_en
};
Expand Down Expand Up @@ -829,7 +828,7 @@ const struct Nif *gpio_nif_get_nif(const char *nifname)
return &gpio_hold_dis_nif;
}

#if !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 2) && SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP && !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 3, 2) && !SOC_GPIO_SUPPORT_HOLD_SINGLE_IO_IN_DSLP)
if (strcmp("gpio:deep_sleep_hold_en/0", nifname) == 0 || strcmp("Elixir.GPIO:deep_sleep_hold_en/0", nifname) == 0) {
TRACE("Resolved platform nif %s ...\n", nifname);
return &gpio_deep_sleep_hold_en_nif;
Expand Down

0 comments on commit af0f64d

Please sign in to comment.