LED PWM control - resume after ledc_stop?

samsam
Posts: 50
Joined: Sun Jun 04, 2017 5:26 pm

LED PWM control - resume after ledc_stop?

Postby samsam » Mon Jul 03, 2017 4:58 pm

Hello,
2 quick qestions about LEDC PWM control :
- don't see a function to resume PWM after executing:
ledc_stop(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t idle_level)
what will be the procedure to resume the LED PWM?
- ledc_stop(..) - does it stops and the associated timer or the timer need to be stopped with ledc_timer_pause(..)?
Thanks

samsam
Posts: 50
Joined: Sun Jun 04, 2017 5:26 pm

Re: LED PWM control - resume after ledc_stop?

Postby samsam » Tue Jul 04, 2017 4:29 pm

After spent some time browsing driver/ledc.c, I saw that ledc_update_duty(LED_SPEED_MODE, LED_PWM_CHANNEL) has almost all the opposite operations of ledc_stop(LED_SPEED_MODE, LED_PWM_CHANNEL), so I tried and it works Ok so far :)
Also used ledc_timer_pause(..) after ledc_stop(..) and resp. ledc_timer_resume(..) before ledc_update_duty(..)

Who is online

Users browsing this forum: Bing [Bot] and 73 guests