diff --git a/cpu/esp32/esp-idf/esp_idf.mk b/cpu/esp32/esp-idf/esp_idf.mk index 4d2a2b7e31..92cd2315c2 100644 --- a/cpu/esp32/esp-idf/esp_idf.mk +++ b/cpu/esp32/esp-idf/esp_idf.mk @@ -1,6 +1,6 @@ # common definitions for all ESP-IDF modules -# additional include pathes required by als ESP-IDF module +# additional include pathes required by ESP-IDF module INCLUDES += -I$(ESP32_SDK_DIR)/components/bootloader_support/include INCLUDES += -I$(ESP32_SDK_DIR)/components/bootloader_support/include_bootloader INCLUDES += -I$(ESP32_SDK_DIR)/components/driver/$(CPU_FAM)/include diff --git a/cpu/esp32/esp-idf/esp_idf_cflags.mk b/cpu/esp32/esp-idf/esp_idf_cflags.mk index 3e7ac6b896..a78bccfe0b 100644 --- a/cpu/esp32/esp-idf/esp_idf_cflags.mk +++ b/cpu/esp32/esp-idf/esp_idf_cflags.mk @@ -1,5 +1,8 @@ # common definitions for all ESP-IDF modules +# indicate that ESP-IDF code is compiled +CFLAGS += -DESP_IDF_CODE + # shortcuts used by ESP-IDF CFLAGS += -Dasm=__asm CFLAGS += -Dtypeof=__typeof__ diff --git a/cpu/esp32/esp-idf/include/driver/gpio.h b/cpu/esp32/esp-idf/include/driver/gpio.h new file mode 100644 index 0000000000..154519993c --- /dev/null +++ b/cpu/esp32/esp-idf/include/driver/gpio.h @@ -0,0 +1,24 @@ +#ifndef DRIVER_GPIO_H +#define DRIVER_GPIO_H + +#ifdef ESP_IDF_CODE + +#include_next "driver/gpio.h" + +#else + +#include "hal/gpio_types.h" + +#define GPIO_PIN_COUNT (SOC_GPIO_PIN_COUNT) + +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* DRIVER_GPIO_H */