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

[Potential Bug] With customizable layer_state_t, layers shifting might not work. #8310

Closed
alex-ong opened this issue Mar 4, 2020 · 2 comments

Comments

@alex-ong
Copy link
Contributor

alex-ong commented Mar 4, 2020

I'm still investigating, but i'm back on optimizing layer_state_t.

Describe the Potential Bug

Commit: b62e160
added LAYER_STATE_8BIT, LAYER_STATE_16BIT and LAYER_STATE_32BIT.

However this will have a flow on effect in action_layer.c

Layer Shifting might not work due to assumption of uint_32t in layer shifting code.

Additional Context

This was previously discussed in TMK under issue #526
tmk/tmk_keyboard#526

@alex-ong
Copy link
Contributor Author

alex-ong commented Mar 4, 2020

I can't seem to make it break;
i tried LAYER_STATE_8BIT, and defined layers 0 and 7 with an MO(7).

If someone can confirm that the code 110% works we can close the issue that isn't a real issue:

existing code (action.c):

uint8_t shift = action.layer_bitop.part * 4;

theoretical correct code:

#if defined(LAYER_STATE_8BIT)
    return (action.layer_bitop.part & 1) * 4;
#elif defined(LAYER_STATE_16BIT)
    return (action.layer_bitop.part & 3) * 4;
#else    
    return action.layer_bitop.part * 4;
#endif

@zvecr
Copy link
Member

zvecr commented Aug 28, 2022

This issue has been automatically closed because it has not had any recent activity.
If this issue is still valid, re-open the issue and let us know.

@zvecr zvecr closed this as completed Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants