espressif / esp-iot-solution

Espressif IoT Library. IoT Device Drivers, Documentations And Solutions.
Apache License 2.0
1.9k stars 760 forks source link

led_indicator: LED not off on Stop (AEGHB-537) #331

Open diplfranzhoepfinger opened 8 months ago

diplfranzhoepfinger commented 8 months ago

Answers checklist.

General issue report

https://components.espressif.com/components/espressif/led_indicator https://docs.espressif.com/projects/esp-iot-solution/en/latest/display/led_indicator.html

if i define a looped Blink: like this one:

https://github.com/espressif/esp-iot-solution/blob/6359293fbe0727767bd3431c26e33044c3144057/components/led/led_indicator/src/led_indicator_blink_default.c#L15

then i call led_indicator_stop, then it is that the LED is on or off randomly. depending if it was in the on or off state when the stop came in.

the Customer of a stop await that the LED is off in any case.

any solution ?

Thanks, Franz

diplfranzhoepfinger commented 8 months ago

i found a possible Solution:

after Init start a lowest Prio looped OFF, and never stop it. 

when the blinking ends the lowest prio off jumps in.

lijunru-hub commented 8 months ago

You are correct. The 'stop' control logic doesn't actually turn off the light; it simply stops controlling the light. If you want to turn off the light when stopping, you can use the led_indicator_set_on_off function. Manually set the light to the off state during the 'stop' operation.