Moved definition of MAX_LAYERS next to LayerState declaration

Also redefined it in terms of the size of LayerState
pull/254/head
Michael Richters 7 years ago
parent e822c6afad
commit 154f0f3267

@ -3,6 +3,11 @@
static uint8_t DefaultLayer; static uint8_t DefaultLayer;
static uint32_t LayerState; static uint32_t LayerState;
// The maximum number of layers allowed. `LayerState`, which stores
// the on/off status of the layers in a bitfield has only 32 bits, and
// that should be enough for almost any layout.
#define MAX_LAYERS sizeof(LayerState) * 8;
uint8_t Layer_::highestLayer; uint8_t Layer_::highestLayer;
Key Layer_::liveCompositeKeymap[ROWS][COLS]; Key Layer_::liveCompositeKeymap[ROWS][COLS];
uint8_t Layer_::activeLayers[ROWS][COLS]; uint8_t Layer_::activeLayers[ROWS][COLS];

@ -11,11 +11,6 @@
const Key keymaps[][ROWS][COLS] PROGMEM = { layers }; \ const Key keymaps[][ROWS][COLS] PROGMEM = { layers }; \
uint8_t layer_count = sizeof(keymaps) / sizeof(*keymaps); uint8_t layer_count = sizeof(keymaps) / sizeof(*keymaps);
// The maximum number of layers allowed. `LayerState`, which stores
// the on/off status of the layers in a bitfield has only 32 bits, and
// that should be enough for almost any layout.
#define MAX_LAYERS 32
class Layer_ { class Layer_ {
public: public:
Layer_(void); Layer_(void);

Loading…
Cancel
Save