Skip to content

Commit 62b16fc

Browse files
authored
Merge pull request #789 from espzav/fix/gpio_requires
fix: Fixed GPIO implicit declaration
2 parents 2368d94 + 61a7e37 commit 62b16fc

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET ST
9191
list(APPEND srcs driver/sccb.c)
9292
endif()
9393

94+
if (idf_version VERSION_GREATER_EQUAL "6.0")
95+
list(APPEND priv_requires esp_driver_gpio)
96+
endif()
97+
9498
endif()
9599

96100
idf_component_register(

target/esp32/ll_cam.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ static inline int gpio_ll_get_level(gpio_dev_t *hw, int gpio_num)
3939
#endif
4040

4141
#if (ESP_IDF_VERSION_MAJOR >= 5)
42+
#include "driver/gpio.h"
4243
#define GPIO_PIN_INTR_POSEDGE GPIO_INTR_POSEDGE
4344
#define GPIO_PIN_INTR_NEGEDGE GPIO_INTR_NEGEDGE
4445
#define gpio_matrix_in(a,b,c) esp_rom_gpio_connect_in_signal(a,b,c)

target/esp32s2/ll_cam.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#endif
2727

2828
#if (ESP_IDF_VERSION_MAJOR >= 5)
29+
#include "driver/gpio.h"
2930
#define GPIO_PIN_INTR_POSEDGE GPIO_INTR_POSEDGE
3031
#define GPIO_PIN_INTR_NEGEDGE GPIO_INTR_NEGEDGE
3132
#define gpio_matrix_in(a,b,c) esp_rom_gpio_connect_in_signal(a,b,c)

target/esp32s3/ll_cam.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "esp_rom_gpio.h"
2828

2929
#if (ESP_IDF_VERSION_MAJOR >= 5)
30+
#include "driver/gpio.h"
3031
#include "soc/gpio_sig_map.h"
3132
#include "soc/gpio_periph.h"
3233
#include "soc/io_mux_reg.h"

target/xclk.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ esp_err_t camera_enable_out_clock(const camera_config_t* config)
5151
ch_conf.gpio_num = config->pin_xclk;
5252
ch_conf.speed_mode = LEDC_LOW_SPEED_MODE;
5353
ch_conf.channel = config->ledc_channel;
54-
ch_conf.intr_type = LEDC_INTR_DISABLE;
54+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6,0,0)
55+
// no need to explicitly configure interrupt, handled in the driver (IDF v6.0 and above)
56+
ch_conf.intr_type = LEDC_INTR_DISABLE;
57+
#endif
5558
ch_conf.timer_sel = config->ledc_timer;
5659
ch_conf.duty = 1;
5760
ch_conf.hpoint = 0;

0 commit comments

Comments
 (0)