-
-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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
Expose the time of the last change to the LED state #17222
Conversation
We could even consider adding #if defined(OLED_ENABLE) && OLED_TIMEOUT > 0
oled_on();
#endif below |
I like the idea for consistency, but what's the advantage over the "leds != prev_leds" check I use now (
Not intended as a criticism, I'm just curious if checking the last-modified time is roughly equivalent or if my sleepy weekend brain is missing something. :) |
Oh, I guess maybe one difference is that right now, if the host changes LED state (e.g., it's not as a side effect of a key press), then with my current OLED code, the OLED won't wake up, whereas looking at the timer, it would. I'm honestly not sure which behavior I'd prefer, but having the choice would be nice. |
That is indeed the difference, so the interesting line would be this one: qmk_firmware/users/bcat/bcat_oled.c Line 47 in f5d091a
Note that if you change the screen based on a LED state change, than the screen change will trigger |
I see the point, that is an odd edge case. Yeah, it'd be nice to have a more complete "did anything change" API. Thanks for explaining! |
(Cherry-pick from: 0112938)
This PR is in part a question: would the proposed change make sense? It extends #11552 and #11595.
Description
This introduces two new functions that mimic
from
keyboard.h
.Keyboard activity can come from inside (key and/or encoder activity), or from outside. Outside activity happens in the form of USB 'set' reports that can change the LED state.
Types of Changes
Issues Fixed or Closed by This PR
I found user code by @bcat and @snowe2010 that wold benefit from this.
Checklist