esp32[c3|c6|h2]: Fix ledc clk issue

This commit is contained in:
Eren Terzioglu 2024-12-09 12:20:42 +01:00 committed by Alan C. Assis
parent 8256864bfe
commit c3d03f02fb

View file

@ -824,11 +824,16 @@ static int ledc_set_timer_div(ledc_timer_t timer_num,
pwmerr("Timer clock conflict. Already is %d but attempt to %d",
p_ledc_obj->glb_clk,
glb_clk);
return -EINVAL;
}
}
}
if (timer_num == LEDC_TIMER_MAX - 1 &&
p_ledc_obj->glb_clk_is_acquired[timer_num - 1])
{
return -EINVAL;
}
p_ledc_obj->glb_clk_is_acquired[timer_num] = true;
if (p_ledc_obj->glb_clk != glb_clk)
{