Cycling Through LED Modes Causes Right Side Stop Working - Latest Firmware

Hello,

I’m hoping that there is a simple fix for this one. I finally had some free time and decided to update the firmware on both of my Model 01’s. After getting the Arduino IDE and all the required software downloaded I successfully flashed the first keyboard. All seemed will until I cycled through the LED modes by pressing the “led” button. I am able to cycle through the first two modes, on the third press of the “led” button the right half stops working and a single key, the “-” key in the lower right, remains lit and that half remains unresponsive until I unplug and reconnect the Model 01.

After some time the keyboard has sent the following keystrokes to whatever window has focus:

iopuy
=adfgBCVXZ

I decided to flash my second keyboard to see if it was a problem with the first one’s hardware, it now is doing the same thing. Again, thanks in advance for your help.

Conor Richard

I commented out “LEDChaseEffect” and re-compiled the firmware. Everything is working fine now without that effect enabled. The issue seems to be with it.

Conor Richard

Thanks for narrowing it down to Chase, that’ll help us debugging it further.

You’re welcome. If I were better at hardware stuffs I would have perhaps found more for you. Let me know if you need me to test out anything or if you need me to give you any more information that’ll help you track down the issue.

Conor Richard

Narrowing down to Chase and clearly explaining the symptoms was enough to track the issue down. I knew it was working recently, so wasn’t particularly hard to find the commit where I broke it (sorry!). A fix is available at:

There were two underlying problems: the firmware crashed because the LED index went below zero, and the hardware plugin wasn’t prepared for that case. It only checked if the index is smaller than LED_COUNT, it never accounted for the index being negative. This is because originally we used an unsigned integer, but for various reasons, changed to a signed one recently. When it went negative, all kinds of bad stuff happened, and the firmware ended up crashing.

With this fixed, the firmware no longer crashed, but Chase still didn’t work properly, the right half wouldn’t do the effect, and the left had issues as well. This was caused by the same unsigned → signed transition, the code that flipped the direction of the chase did not account for the position being anything less than zero.

The pull request above fixes both, you can take it for a spin if you want to, or wait 'till @jesse merges it when he’s up. :slight_smile:

2 Likes

Awesome. I appreciate the explanation and the quick fix on this. And, I’m happy that I hadn’t borked my keyboards when I finally decided to upgrade the firmware. :smile:

I did checkout your commit and tested it successfully. Everything worked as it should. Thank you!

Conor Richard

1 Like

Hi there,

I just installed the latest example and I’m having the same issue that as I cycle through the led settings the right hand side stops working with the bottom right key lights up.

I checked and these changes are in the source code that I checked out. Any thoughts.

Thanks,
Kevin

Hey @netikular I just deleted the chase effect from the firmware and things are back to normal. So far all the others LED effects are working fine so I think it was just that.

By latest firmware, do you mean latest available via the Arduino boards manager, or latest from git?