Merge pull request #11598 from Jason2866/patch-3

IDF version related
This commit is contained in:
Theo Arends 2021-04-06 08:40:09 +02:00 committed by GitHub
commit aa2b6043ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -187,7 +187,7 @@ void directModeInput(IO_REG_TYPE pin)
{
if ( digitalPinIsValid(pin) )
{
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#if ESP_IDF_VERSION_MAJOR < 4 // IDF 3.x ESP32/PICO-D4
uint32_t rtc_reg(rtc_gpio_desc[pin].reg);
if ( rtc_reg ) // RTC pins PULL settings
@ -195,7 +195,7 @@ void directModeInput(IO_REG_TYPE pin)
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].mux);
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].pullup | rtc_gpio_desc[pin].pulldown);
}
#elif CONFIG_IDF_TARGET_ESP32S2 // ESP32-S2
#elif ESP_IDF_VERSION_MAJOR > 3 // ESP32-S2 needs IDF 4.2 or later
uint32_t rtc_reg(rtc_io_desc[pin].reg);
if ( rtc_reg ) // RTC pins PULL settings
@ -225,7 +225,7 @@ void directModeOutput(IO_REG_TYPE pin)
{
if ( digitalPinIsValid(pin) && pin <= 33 ) // pins above 33 can be only inputs
{
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#if ESP_IDF_VERSION_MAJOR < 4 // IDF 3.x ESP32/PICO-D4
uint32_t rtc_reg(rtc_gpio_desc[pin].reg);
if ( rtc_reg ) // RTC pins PULL settings
@ -233,7 +233,7 @@ void directModeOutput(IO_REG_TYPE pin)
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].mux);
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].pullup | rtc_gpio_desc[pin].pulldown);
}
#elif CONFIG_IDF_TARGET_ESP32S2 // ESP32-S2
#elif ESP_IDF_VERSION_MAJOR > 3 // ESP32-S2 needs IDF 4.2 or later
uint32_t rtc_reg(rtc_io_desc[pin].reg);
if ( rtc_reg ) // RTC pins PULL settings