Skip to content

Commit 896cb70

Browse files
committed
Make xclk pin optional
Some camera modules come with a crystal oscillator that already provides the main clock, and they don't have the xclk/mclk pin. We don't need to initialize the PWM pin then.
1 parent 5611989 commit 896cb70

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

target/xclk.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ esp_err_t xclk_timer_conf(int ledc_timer, int xclk_freq_hz)
3535

3636
esp_err_t camera_enable_out_clock(camera_config_t* config)
3737
{
38+
if (config->ledc_channel == NO_CAMERA_LEDC_CHANNEL) {
39+
g_ledc_channel = NO_CAMERA_LEDC_CHANNEL;
40+
return ESP_OK;
41+
}
42+
3843
esp_err_t err = xclk_timer_conf(config->ledc_timer, config->xclk_freq_hz);
3944
if (err != ESP_OK) {
4045
ESP_LOGE(TAG, "ledc_timer_config failed, rc=%x", err);

0 commit comments

Comments
 (0)