Improve compatibility with future ESP-IDF versions

This commit is contained in:
Manuel Bleichenbacher 2022-01-30 20:27:18 +01:00
parent f06be4c069
commit ee8eead337
2 changed files with 6 additions and 6 deletions

View File

@ -9,6 +9,7 @@ set(COMPONENT_ADD_INCLUDEDIRS
)
set(COMPONENT_REQUIRES
nvs_flash
mbedtls
)
register_component()

View File

@ -19,7 +19,6 @@
#include "freertos/semphr.h"
#include "driver/gpio.h"
#include "driver/spi_master.h"
#include "driver/timer.h"
#include "esp_timer.h"
#include "esp_log.h"
#include <time.h>
@ -116,30 +115,30 @@ void init_io(void)
ASSERT(pin_dio0 != LMIC_UNUSED_PIN);
ASSERT(pin_dio1 != LMIC_UNUSED_PIN);
gpio_pad_select_gpio(pin_nss);
gpio_reset_pin(pin_nss);
gpio_set_level(pin_nss, 0);
gpio_set_direction(pin_nss, GPIO_MODE_OUTPUT);
if (pin_rx_tx != LMIC_UNUSED_PIN)
{
gpio_pad_select_gpio(pin_rx_tx);
gpio_reset_pin(pin_rx_tx);
gpio_set_level(pin_rx_tx, 0);
gpio_set_direction(pin_rx_tx, GPIO_MODE_OUTPUT);
}
if (pin_rst != LMIC_UNUSED_PIN)
{
gpio_pad_select_gpio(pin_rst);
gpio_reset_pin(pin_rst);
gpio_set_level(pin_rst, 0);
gpio_set_direction(pin_rst, GPIO_MODE_OUTPUT);
}
// DIO pins with interrupt handlers
gpio_pad_select_gpio(pin_dio0);
gpio_reset_pin(pin_dio0);
gpio_set_direction(pin_dio0, GPIO_MODE_INPUT);
gpio_set_intr_type(pin_dio0, GPIO_INTR_POSEDGE);
gpio_pad_select_gpio(pin_dio1);
gpio_reset_pin(pin_dio1);
gpio_set_direction(pin_dio1, GPIO_MODE_INPUT);
gpio_set_intr_type(pin_dio1, GPIO_INTR_POSEDGE);