Skip to content

Commit

Permalink
IDF master cf457d412 (#5073)
Browse files Browse the repository at this point in the history
esp-dsp: master 7cc5073
esp-face: master 420fc7e
esp-rainmaker: f1b82c7
esp32-camera: master 2dded7c
esp_littlefs: master d268e18
  • Loading branch information
me-no-dev authored Apr 17, 2021
1 parent 11f89cd commit 5d9b98c
Show file tree
Hide file tree
Showing 694 changed files with 12,775 additions and 3,426 deletions.
8 changes: 4 additions & 4 deletions platform.txt

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion tools/platformio-build-esp32.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "freertos", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "freertos", "port", "xtensa", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_hw_support", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_hw_support", "include", "soc"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_hw_support", "port", "esp32"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "heap", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "log", "include"),
Expand All @@ -127,6 +128,8 @@
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_rom", "esp32"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_common", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_system", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_system", "port", "soc"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_system", "port", "public_compat"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp32", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "driver", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "driver", "esp32", "include"),
Expand Down Expand Up @@ -158,6 +161,7 @@
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_gdbstub", "xtensa"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_gdbstub", "esp32"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "espcoredump", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "espcoredump", "include", "port", "xtensa"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "wpa_supplicant", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "wpa_supplicant", "port", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "wpa_supplicant", "include", "esp_supplicant"),
Expand Down Expand Up @@ -273,7 +277,7 @@
"UNITY_INCLUDE_CONFIG_H",
"WITH_POSIX",
"_GNU_SOURCE",
("IDF_VER", '\\"v4.4-dev-744-g1cb31e509\\"'),
("IDF_VER", '\\"v4.4-dev-960-gcf457d412\\"'),
"ESP_PLATFORM",
"ARDUINO_ARCH_ESP32",
"ESP32",
Expand Down
7 changes: 5 additions & 2 deletions tools/platformio-build-esp32c3.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
],

LINKFLAGS=[
"-mlongcalls",
"-nostartfiles",
"-march=rv32imc",
"--specs=nosys.specs",
Expand Down Expand Up @@ -111,6 +110,7 @@
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "freertos", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "freertos", "port", "riscv", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_hw_support", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_hw_support", "include", "soc"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_hw_support", "port", "esp32c3"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_hw_support", "port", "esp32c3", "private_include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "heap", "include"),
Expand All @@ -129,6 +129,8 @@
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_rom", "esp32c3"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_common", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_system", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_system", "port", "soc"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_system", "port", "public_compat"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp32c3", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "driver", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "driver", "esp32c3", "include"),
Expand Down Expand Up @@ -158,6 +160,7 @@
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_gdbstub", "riscv"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_gdbstub", "esp32c3"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "espcoredump", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "espcoredump", "include", "port", "riscv"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "wpa_supplicant", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "wpa_supplicant", "port", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "wpa_supplicant", "include", "esp_supplicant"),
Expand Down Expand Up @@ -234,7 +237,7 @@
"UNITY_INCLUDE_CONFIG_H",
"WITH_POSIX",
"_GNU_SOURCE",
("IDF_VER", '\\"v4.4-dev-744-g1cb31e509\\"'),
("IDF_VER", '\\"v4.4-dev-960-gcf457d412\\"'),
"ESP_PLATFORM",
"ARDUINO_ARCH_ESP32",
"ESP32",
Expand Down
6 changes: 5 additions & 1 deletion tools/platformio-build-esp32s2.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "freertos", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "freertos", "port", "xtensa", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_hw_support", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_hw_support", "include", "soc"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_hw_support", "port", "esp32s2"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_hw_support", "port", "esp32s2", "private_include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "heap", "include"),
Expand All @@ -124,6 +125,8 @@
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_rom", "esp32s2"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_common", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_system", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_system", "port", "soc"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_system", "port", "public_compat"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp32s2", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "driver", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "driver", "esp32s2", "include"),
Expand Down Expand Up @@ -155,6 +158,7 @@
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_gdbstub", "xtensa"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_gdbstub", "esp32s2"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "espcoredump", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "espcoredump", "include", "port", "xtensa"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "wpa_supplicant", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "wpa_supplicant", "port", "include"),
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "wpa_supplicant", "include", "esp_supplicant"),
Expand Down Expand Up @@ -262,7 +266,7 @@
"UNITY_INCLUDE_CONFIG_H",
"WITH_POSIX",
"_GNU_SOURCE",
("IDF_VER", '\\"v4.4-dev-744-g1cb31e509\\"'),
("IDF_VER", '\\"v4.4-dev-960-gcf457d412\\"'),
"ESP_PLATFORM",
"ARDUINO_ARCH_ESP32",
"ESP32",
Expand Down
Binary file modified tools/sdk/esp32/bin/bootloader_dio_40m.bin
Binary file not shown.
Binary file modified tools/sdk/esp32/bin/bootloader_dio_80m.bin
Binary file not shown.
Binary file modified tools/sdk/esp32/bin/bootloader_dout_40m.bin
Binary file not shown.
Binary file modified tools/sdk/esp32/bin/bootloader_dout_80m.bin
Binary file not shown.
Binary file modified tools/sdk/esp32/bin/bootloader_qio_40m.bin
Binary file not shown.
Binary file modified tools/sdk/esp32/bin/bootloader_qio_80m.bin
Binary file not shown.
Binary file modified tools/sdk/esp32/bin/bootloader_qout_40m.bin
Binary file not shown.
Binary file modified tools/sdk/esp32/bin/bootloader_qout_80m.bin
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ typedef void (* esp_blufi_event_cb_t)(esp_blufi_cb_event_t event, esp_blufi_cb_p
* @param len : length of data from phone
* @param output_data : data want to send to phone
* @param output_len : length of data want to send to phone
* @param need_free : output reporting if memory needs to be freed or not *
*/
typedef void (*esp_blufi_negotiate_data_handler_t)(uint8_t *data, int len, uint8_t **output_data, int *output_len, bool *need_free);

Expand All @@ -311,7 +312,7 @@ typedef void (*esp_blufi_negotiate_data_handler_t)(uint8_t *data, int len, uint8
* @param crypt_len : length of plain text
* @return Nonnegative number is encrypted length, if error, return negative number;
*/
typedef int (* esp_blufi_encrypt_func_t)(uint8_t iv8, uint8_t *crypt_data, int cyprt_len);
typedef int (* esp_blufi_encrypt_func_t)(uint8_t iv8, uint8_t *crypt_data, int crypt_len);

/**
* @brief BLUFI decrypt the data after negotiate a share key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ typedef union {
/**
* @brief GATT Client callback function type
* @param event : Event type
* @param gatts_if : GATT client access interface, normally
* @param gattc_if : GATT client access interface, normally
* different gattc_if correspond to different profile
* @param param : Point to callback parameter, currently is union type
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ typedef void (* esp_hf_incoming_data_cb_t)(const uint8_t *buf, uint32_t len);
*
* @param[in] len : size(in bytes) in buf
*
* @param[out] length of data successfully read
* @return length of data successfully read
*/
typedef uint32_t (* esp_hf_outgoing_data_cb_t) (uint8_t *buf, uint32_t len);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ typedef void (* esp_hf_client_incoming_data_cb_t)(const uint8_t *buf, uint32_t l
*
* @param[in] len : size(in bytes) in buf
*
* @param[out] length of data successfully read
* @return length of data successfully read
*
*/
typedef uint32_t (* esp_hf_client_outgoing_data_cb_t)(uint8_t *buf, uint32_t len);
Expand Down
10 changes: 4 additions & 6 deletions tools/sdk/esp32/include/config/sdkconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,12 @@
#define CONFIG_PICO_PSRAM_CS_IO 10
#define CONFIG_SPIRAM_SPIWP_SD3_PIN 7
#define CONFIG_ESP32_TRACEMEM_RESERVE_DRAM 0x0
#define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR 1
#define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES 4
#define CONFIG_ESP32_ULP_COPROC_ENABLED 1
#define CONFIG_ESP32_ULP_COPROC_RESERVE_MEM 512
#define CONFIG_ESP32_DEBUG_OCDAWARE 1
#define CONFIG_ESP32_BROWNOUT_DET 1
#define CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0 1
#define CONFIG_ESP32_BROWNOUT_DET_LVL 0
#define CONFIG_ESP32_REDUCE_PHY_TX_POWER 1
#define CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1 1
#define CONFIG_ESP32_RTC_CLK_SRC_INT_RC 1
#define CONFIG_ESP32_RTC_CLK_CAL_CYCLES 1024
Expand Down Expand Up @@ -239,6 +236,8 @@
#define CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP 1
#define CONFIG_ESP_MAC_ADDR_UNIVERSE_BT 1
#define CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH 1
#define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR 1
#define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES 4
#define CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL 120
#define CONFIG_ESP_NETIF_TCPIP_LWIP 1
#define CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER 1
Expand Down Expand Up @@ -286,6 +285,7 @@
#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE 1
#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20
#define CONFIG_ESP32_PHY_MAX_TX_POWER 20
#define CONFIG_ESP32_REDUCE_PHY_TX_POWER 1
#define CONFIG_ESP_COREDUMP_ENABLE_TO_NONE 1
#define CONFIG_FATFS_CODEPAGE_850 1
#define CONFIG_FATFS_CODEPAGE 850
Expand Down Expand Up @@ -391,8 +391,6 @@
#define CONFIG_LWIP_MAX_RAW_PCBS 16
#define CONFIG_LWIP_DHCP_MAX_NTP_SERVERS 1
#define CONFIG_LWIP_SNTP_UPDATE_DELAY 3600000
#define CONFIG_LCP_ECHOINTERVAL 0
#define CONFIG_LCP_MAXECHOFAILS 3
#define CONFIG_LWIP_ESP_LWIP_ASSERT 1
#define CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT 1
#define CONFIG_LWIP_HOOK_IP6_ROUTE_NONE 1
Expand Down Expand Up @@ -654,5 +652,5 @@
#define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED
#define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
#define CONFIG_ARDUINO_IDF_COMMIT "1cb31e509"
#define CONFIG_ARDUINO_IDF_COMMIT "cf457d412"
#define CONFIG_ARDUINO_IDF_BRANCH "master"
4 changes: 4 additions & 0 deletions tools/sdk/esp32/include/driver/include/driver/dedic_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include "esp_attr.h"
#include "soc/soc_caps.h"

#if SOC_DEDICATED_GPIO_SUPPORTED

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -171,3 +173,5 @@ esp_err_t dedic_gpio_bundle_set_interrupt_and_callback(dedic_gpio_bundle_handle_
#ifdef __cplusplus
}
#endif

#endif //SOC_DEDICATED_GPIO_SUPPORTED
24 changes: 1 addition & 23 deletions tools/sdk/esp32/include/driver/include/driver/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
Expand Down Expand Up @@ -494,28 +494,6 @@ esp_err_t gpio_sleep_set_direction(gpio_num_t gpio_num, gpio_mode_t mode);
* - ESP_ERR_INVALID_ARG : Parameter error
*/
esp_err_t gpio_sleep_set_pull_mode(gpio_num_t gpio_num, gpio_pull_mode_t pull);

#if CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL
/**
* @brief Emulate ESP32S2 behaviour to backup FUN_PU, FUN_PD information
*
* @note Need to be called before sleep.
*
* @return
* - ESP_OK Success
*/
esp_err_t gpio_sleep_pupd_config_apply(gpio_num_t gpio_num);

/**
* @brief Emulate ESP32S2 behaviour to restore FUN_PU, FUN_PD information
*
* @note Need to be called after sleep.
*
* @return
* - ESP_OK Success
*/
esp_err_t gpio_sleep_pupd_config_unapply(gpio_num_t gpio_num);
#endif
#endif

#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
Expand Down
32 changes: 31 additions & 1 deletion tools/sdk/esp32/include/driver/include/driver/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,39 @@ extern "C" {

#define I2C_APB_CLK_FREQ APB_CLK_FREQ /*!< I2C source clock is APB clock, 80MHz */

#define I2C_NUM_MAX (SOC_I2C_NUM) /*!< I2C port max */
#define I2C_NUM_0 (0) /*!< I2C port 0 */
#if SOC_I2C_NUM >= 2
#define I2C_NUM_1 (1) /*!< I2C port 1 */
#define I2C_NUM_MAX (SOC_I2C_NUM) /*!< I2C port max */
#endif

// I2C clk flags for users to use, can be expanded in the future.
#define I2C_SCLK_SRC_FLAG_FOR_NOMAL (0) /*!< Any one clock source that is available for the specified frequency may be choosen*/
#define I2C_SCLK_SRC_FLAG_AWARE_DFS (1 << 0) /*!< For REF tick clock, it won't change with APB.*/
#define I2C_SCLK_SRC_FLAG_LIGHT_SLEEP (1 << 1) /*!< For light sleep mode.*/

/**
* @brief I2C initialization parameters
*/
typedef struct{
i2c_mode_t mode; /*!< I2C mode */
int sda_io_num; /*!< GPIO number for I2C sda signal */
int scl_io_num; /*!< GPIO number for I2C scl signal */
bool sda_pullup_en; /*!< Internal GPIO pull mode for I2C sda signal*/
bool scl_pullup_en; /*!< Internal GPIO pull mode for I2C scl signal*/

union {
struct {
uint32_t clk_speed; /*!< I2C clock frequency for master mode, (no higher than 1MHz for now) */
} master; /*!< I2C master config */
struct {
uint8_t addr_10bit_en; /*!< I2C 10bit address mode enable for slave mode */
uint16_t slave_addr; /*!< I2C address for slave mode */
} slave; /*!< I2C slave config */
};
uint32_t clk_flags; /*!< Bitwise of ``I2C_SCLK_SRC_FLAG_**FOR_DFS**`` for clk source choice*/
} i2c_config_t;


typedef void *i2c_cmd_handle_t; /*!< I2C command handle */

Expand Down
34 changes: 18 additions & 16 deletions tools/sdk/esp32/include/driver/include/driver/i2s.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "hal/i2s_types.h"
#include "driver/periph_ctrl.h"
#include "esp_intr_alloc.h"

#if SOC_I2S_SUPPORTS_ADC_DAC
#include "driver/adc.h"
#endif
Expand Down Expand Up @@ -82,21 +83,6 @@ esp_err_t i2s_set_pin(i2s_port_t i2s_num, const i2s_pin_config_t *pin);
esp_err_t i2s_set_pdm_rx_down_sample(i2s_port_t i2s_num, i2s_pdm_dsr_t dsr);
#endif

/**
* @brief Set I2S dac mode, I2S built-in DAC is disabled by default
*
* @param dac_mode DAC mode configurations - see i2s_dac_mode_t
*
* @note Built-in DAC functions are only supported on I2S0 for current ESP32 chip.
* If either of the built-in DAC channel are enabled, the other one can not
* be used as RTC DAC function at the same time.
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_ARG Parameter error
*/
esp_err_t i2s_set_dac_mode(i2s_dac_mode_t dac_mode);

/**
* @brief Install and start I2S driver.
*
Expand Down Expand Up @@ -331,7 +317,23 @@ esp_err_t i2s_adc_enable(i2s_port_t i2s_num);
* - ESP_ERR_INVALID_STATE Driver state error
*/
esp_err_t i2s_adc_disable(i2s_port_t i2s_num);
#endif

/**
* @brief Set I2S dac mode, I2S built-in DAC is disabled by default
*
* @param dac_mode DAC mode configurations - see i2s_dac_mode_t
*
* @note Built-in DAC functions are only supported on I2S0 for current ESP32 chip.
* If either of the built-in DAC channel are enabled, the other one can not
* be used as RTC DAC function at the same time.
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_ARG Parameter error
*/
esp_err_t i2s_set_dac_mode(i2s_dac_mode_t dac_mode);
#endif //SOC_I2S_SUPPORTS_ADC_DAC


#ifdef __cplusplus
}
Expand Down
11 changes: 4 additions & 7 deletions tools/sdk/esp32/include/driver/include/driver/rtc_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@

#include <stdint.h>
#include "esp_err.h"
#include "driver/gpio.h"
#include "soc/soc_caps.h"
#include "soc/rtc_io_periph.h"
#include "hal/rtc_io_types.h"
#include "driver/gpio.h"


#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -42,6 +44,7 @@ static inline bool rtc_gpio_is_valid_gpio(gpio_num_t gpio_num)

#define RTC_GPIO_IS_VALID_GPIO(gpio_num) rtc_gpio_is_valid_gpio(gpio_num) // Deprecated, use rtc_gpio_is_valid_gpio()

#if SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
/**
* @brief Get RTC IO index number by gpio number.
*
Expand All @@ -52,15 +55,9 @@ static inline bool rtc_gpio_is_valid_gpio(gpio_num_t gpio_num)
*/
static inline int rtc_io_number_get(gpio_num_t gpio_num)
{
#if SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
return rtc_io_num_map[gpio_num];
#else
return gpio_num;
#endif
}

#if SOC_RTCIO_INPUT_OUTPUT_SUPPORTED

/**
* @brief Init a GPIO as RTC GPIO
*
Expand Down
Loading

0 comments on commit 5d9b98c

Please sign in to comment.