Skip to content
This repository was archived by the owner on Jun 15, 2020. It is now read-only.

Commit 14b6170

Browse files
committed
fix xclk for latest IDF
1 parent 34a3546 commit 14b6170

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

components/camera/xclk.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,26 @@ esp_err_t camera_enable_out_clock(camera_config_t* config)
1010
{
1111
periph_module_enable(PERIPH_LEDC_MODULE);
1212

13-
ledc_timer_config_t timer_conf;
14-
timer_conf.duty_resolution = 1;
15-
timer_conf.freq_hz = config->xclk_freq_hz;
16-
timer_conf.speed_mode = LEDC_HIGH_SPEED_MODE;
17-
timer_conf.timer_num = config->ledc_timer;
13+
ledc_timer_config_t timer_conf = {
14+
.duty_resolution = 1,
15+
.freq_hz = config->xclk_freq_hz,
16+
.speed_mode = LEDC_HIGH_SPEED_MODE,
17+
.timer_num = config->ledc_timer
18+
};
1819
esp_err_t err = ledc_timer_config(&timer_conf);
1920
if (err != ESP_OK) {
2021
ESP_LOGE(TAG, "ledc_timer_config failed, rc=%x", err);
2122
return err;
2223
}
2324

24-
ledc_channel_config_t ch_conf;
25-
ch_conf.channel = config->ledc_channel;
26-
ch_conf.timer_sel = config->ledc_timer;
27-
ch_conf.intr_type = LEDC_INTR_DISABLE;
28-
ch_conf.duty = 1;
29-
ch_conf.speed_mode = LEDC_HIGH_SPEED_MODE;
30-
ch_conf.gpio_num = config->pin_xclk;
25+
ledc_channel_config_t ch_conf = {
26+
.channel = config->ledc_channel,
27+
.timer_sel = config->ledc_timer,
28+
.intr_type = LEDC_INTR_DISABLE,
29+
.duty = 1,
30+
.speed_mode = LEDC_HIGH_SPEED_MODE,
31+
.gpio_num = config->pin_xclk
32+
};
3133
err = ledc_channel_config(&ch_conf);
3234
if (err != ESP_OK) {
3335
ESP_LOGE(TAG, "ledc_channel_config failed, rc=%x", err);

0 commit comments

Comments
 (0)