Page 1 of 1

ledc - Test free timer

Posted: Sat Feb 05, 2022 4:14 pm
by Arnaud
Hello,

I'm currently working on an Arduino library use to drive DC motors via ledc PWM signals.
Durring ledc initialization, I need to test if a timer is already used or not (i.e. by another lib) to implement an automatic timer managerial. My idea was to use the ledc_get_freq() function to achieve this (return 0 if not set) but, unfortunately, it seems that using this one on a not configured timer crash and reboot my ESP32.

I did a lot of research but don't find a way to solve my problem. Could someone give me some advice about this?

Many thaks in advance,

Sincerely,

Arnaud