tmk_keyboard
tmk_keyboard copied to clipboard
User Definable NUM_LAYERS. Builds upon layer_state_t
Users can now define NUM_LAYERS. I haven't yet tested:
#if NUM_LAYERS > 16 // layer_state is uint32_t
return action.layer_bitop.part*4;
#elif NUM_LAYERS > 8 // unit16_t
return (action.layer_bitop.part & 3)*4;
#else // uint8_t
return (action.layer_bitop.part & 1)*4;
#endif
- Major space saving from using uint8_t instead of uint32_t, on the order of 300+ bytes.
- Minor time saving for all the bitshifts.
TODO: define constant "Layer_size_ONE" as ((layer_state_t)1) for all bitshifting everywhere.
I pulled the changes and did quick test, it looks promissing! I'll look into codes closely and do some tests later.
For someone intrested this PR is related to this discussion #523 and supercedes PR #526.