Skip to content

Conversation

alex-ong
Copy link
Contributor

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.

@tmk
Copy link
Owner

tmk commented Jan 25, 2018

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.

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

Successfully merging this pull request may close these issues.

2 participants