Skip to content
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

Colour override is incorrect for value 126 #9

Open
dozius opened this issue Feb 18, 2021 · 3 comments
Open

Colour override is incorrect for value 126 #9

dozius opened this issue Feb 18, 2021 · 3 comments

Comments

@dozius
Copy link

dozius commented Feb 18, 2021

Sending a colour override value of 126 results in the LED being set to the active colour state instead of the override colour.

According to the manual, this is how colour override works.

0 = inactive colour state
127 = active colour state
1 to 126 = override colours

This line appears to be the source of the issue. It should be < 127 or <= 126 in order to operate as described in the manual.

} else if (value >0 && value < 126) { // Exclude 126 as we don't allow user to set color to white

@dozius
Copy link
Author

dozius commented Sep 10, 2021

In a way, yes. It tells us whoever wrote this code didn't understand that index 127 is white and not index 126 when they wrote it.

The colour indexes are clearly defined in colorMap.c. The expected behaviour is clearly defined in the manual. I see no reason to think this is intended rather than a mistake.

@doodlebro
Copy link

doodlebro commented Dec 27, 2022

I think this was intentional, with justification relating to the shift page function and active state of the switches therein.

In encoders.c, run_shift_mode's docstring states that the white RGB color is reserved for showing active state of the shift page switch:

* Shift mode is an alternate operation mode which is accessed by the side buttons
* In shift mode the encoders do not do anything, only the switches have effect.
* All 11 position LEDs are turned on and the RGB set to white if active.

So, this seems like an intentional implementation detail, however there is a bug in the latest firmware since the RGB LED stays unlit when shift page switches are pressed:

set_encoder_rgb(idx, 0);

The fix is easy, of course. Just change the 0 to 127. There are a lot of little QoL bugs like this I am catching, I plan to release fixes for them publicly, either as a PR to this repo or a fork. I know there are still license details to work out.

One example, I think it is a bug that the shift pages are not banked. Unless there are space limitations on the microcontroller, all functions should be banked, or this should be a user-configurable setting at least. This device has a ton of potential (and is already quite powerful!), it just needs that last bit of polish to really make it sing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@doodlebro @dozius and others