Skip to content

Commit

Permalink
esp32[c3|c6|h2]: Fix ledc clk issue
Browse files Browse the repository at this point in the history
  • Loading branch information
eren-terzioglu committed Dec 17, 2024
1 parent 60e1a68 commit 0d7f66e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/risc-v/src/common/espressif/esp_ledc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 0d7f66e

Please sign in to comment.