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
[BUG] keybow2040: RGB causing infinite loop #859
Comments
I am having the same issue. I just started to play with RGB module and noticed that the keypad would become unresponsive to key presses when one of the more intricate RGB sequences were selected. Ones tried
KC.RGB_MODE_PLAIN and KC.RGB_MODE_BREATHE don't appear to be affected. One workaround is to throttle the RGB updates via the refresh_rate setting
On mine I found that 35 appears to be the upper limit, but key press start to get unreliable. Lower is better but it makes the RGB update slowly Hardware: |
#862 is an improvement but my board still isn't behaving quite as expected. Keypress are now sometimes registered. However if it is, characters are repeated many times as if they HID signal is being repeatedly sent or the key is being held down. (e.g. "aaaaaaaaaa"). Thanks @xs5871 for proposing a fix so quickly 🎉. |
You're right that #862 only fixes the infinite loop.
That is the "expected" behaviour and unintuitively not a bug. Compounding factors are:
|
That makes sense. Would a sensible thing be to change the keybow2040 example to use a less expensive RGB animation? Happy to play around with that to find something that makes the keyboard more responsive. |
Funny you should say that. I was playing around with the RGB and found a way to increase the RGB update efficiency. |
@JeffreyStocker #864 Doesn't seem to make much difference on my Keybow2040. It still isn't really usable with the more intense RGB animations. |
@JimMadge Check your refresh_rate that your passing into the RGB module. See what happens when you lower the refresh_rate One thing I'm seeing, looking at the spec page of the Keybow2040 is that it is using a LED matrix driver, (maybe a custom code to control it?) The way Neopixels and many strip LED work is by a message to the first LED and then that LED pass the message to the next LED. So I'm the code is gaining a lot of performance I'm having only 1 message be sent per update cycle, rather than 12 messages (I have 12 LEDS). |
Describe the bug
When using the example keybow2040 configuration, current CircuitPython and current kmk library, button presses have no effect. After a while CircuitPython soft resets.
Disabling the RGB, or forcing an exit from the
_process_timeouts
loop is a workaround.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Keyboard responds to button presses.
Debug output
repeatedly (different numbers)
Additional context
kmk_firmware/boards/pimoroni/keybow_2040/code.py
Line 15 in 4b5d6a3
key presses work as expected
_process_timouts()
never returns.The loop does not end.
kmk_firmware/kmk/kmk_keyboard.py
Lines 275 to 277 in 4b5d6a3
If you force this loop to exit early (say, by calling return after 10 iterations), key presses again work, but the RGB stops cycling.
So, I suspect that calls to update the RGB LEDs are filling the task queue and preventing the HID functions in
go
from being called.I'm not very familiar with async but I'm happy to help debug if you have any suggestions.
The text was updated successfully, but these errors were encountered: