pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
197 stars 167 forks source link

modled.c, mperror.c: Ensure 280µs reset time for the RGB LED #509

Closed robert-hh closed 2 years ago

robert-hh commented 3 years ago

Otherwise, if two consecutive calls to pycom.rgbled() are called, the second one may not get effective.

peter-pycom commented 3 years ago

some context: https://forum.pycom.io/topic/6674/what-do-i-misunderstand-about-rgbled/19

robert-hh commented 3 years ago

I consider this PR supportive - and because of that I made it. It should however be noted, that indeed the trailing of consecutive calls to pycom.rgbled() will be delayed, up to 280 µs. That is because pycom.rgbled() waits for the previous rgbled cycle to be finished. Instead one can always wait in the own code doing something reasonable instead of waiting.