diff --git a/src/layers.cpp b/src/layers.cpp index 7bfe05ab..0cf9129d 100644 --- a/src/layers.cpp +++ b/src/layers.cpp @@ -8,6 +8,9 @@ Key Layer_::liveCompositeKeymap[ROWS][COLS]; uint8_t Layer_::activeLayers[ROWS][COLS]; Key(*Layer_::getKey)(uint8_t layer, byte row, byte col) = Layer.getKeyFromPROGMEM; +// The total number of defined layers in the firmware sketch keymaps[] array +uint8_t LayerCount __attribute__((weak)) = 0; + static void handleKeymapKeyswitchEvent(Key keymapEntry, uint8_t keyState) { if (keymapEntry.keyCode >= LAYER_SHIFT_OFFSET) { uint8_t target = keymapEntry.keyCode - LAYER_SHIFT_OFFSET; diff --git a/src/layers.h b/src/layers.h index 19512477..f34ce0e4 100644 --- a/src/layers.h +++ b/src/layers.h @@ -6,10 +6,7 @@ #define CREATE_KEYMAP(layers...) \ const Key keymaps[][ROWS][COLS] PROGMEM = { layers }; \ - const uint8_t LayerCount = sizeof(keymaps) / sizeof(*keymaps); - -// The total number of defined layers in the firmware sketch keymaps[] array -extern const uint8_t LayerCount; + uint8_t LayerCount = sizeof(keymaps) / sizeof(*keymaps); class Layer_ {