-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Simplify the status LED to save power #4743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I tested: the green blink after the code ends, red on exception and yellow when reset to safe mode.
On a Feather M4 and Feather M0 Express, the LED stays either black or lit. It comes back to life when doing things like opening the drive in the Finder or activating and sending data to CDC2. |
Thanks for finding this! I'm able to reproduce it but can't find the issue. Will have to get the debugger out tomorrow. |
This also removes the need to pin share because we don't use the status LED while user code is running. The status flashes fallback to the HW_STATUS LED if no RGB LED is present. Each status has a unique blink pattern as well. One caveat is the REPL state. In order to not pin share, we set the RGB color once. PWM and single color will be shutoff immediately but DotStars and NeoPixels will hold the color until the user overrides it. Fixes micropython#4133
e96dcc2
to
2464f2a
Compare
2464f2a
to
5c33c9d
Compare
Led does not turn on Adafruit CircuitPython 7.0.0-alpha.2-573-g49bad0797 on 2021-05-14; Adafruit Feather M4 CAN with same51j19a Neopixel only turns green on bootoader mode. |
I think this was broken before this change. The M4 CAN has a neopixel power pin that the core doesn't know how to turn on. On some boards with turn it off and on with |
This no longer turns on status LED power before running user code. Therefore, use of the status LED on some boards will also have to enable the power.
This causes safe mode to skip the wait for reset when waking up from an alarm. (It also means we don't flash the LED for it.)
@jposada202020 Please test the latest artifacts. The M4 CAN has a power enable pin for the neopixel that should now be handled. @hierophect I've fixed the STM safe mode blinks too. It didn't have the reset reason implemented which caused CP to wait for safe mode reset after each deep sleep. |
Tested on Adafruit CircuitPython 7.0.0-alpha.2-608-gd134e2af8 on 2021-05-19; Adafruit Feather M4 CAN with same51j19a ResultsREPL : NO lightInit : 3 Yellow - 1 GreenCode Running: 1 Green every 5-6 secCode Error: 2 RedsBootloader: Green all the time |
7af33cd
to
499a438
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested final change on MagTag. LEDs are acting as expected - purple, three yellow blinks on startup, and blinking three yellows when in safe mode.
We can PR them after this one is merged, but there are 2 more boards that need their
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested safe mode on ItsyBitsy, it now works properly. LEDs are intermittently flashing yellow as expected. Flashing on startup was also as expected.
This also removes the need to pin share because we don't use the
status LED while user code is running.
The status flashes fallback to the HW_STATUS LED if no RGB LED is
present. Each status has a unique blink pattern as well.
One caveat is the REPL state. In order to not pin share, we set the
RGB color once. PWM and single color will be shutoff immediately but
DotStars and NeoPixels will hold the color until the user overrides
it.
Fixes #4133