From 3eb491ca69b77a67b225bc6c01557863a5837cd0 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 22 Jan 2016 19:12:04 -0800 Subject: [PATCH] Simplify our keymap generation --- KeyboardConfig.h | 5 +++++ KeyboardioFirmware.h | 1 + Makefile | 1 - generated/keymaps.h | 8 -------- keymaps_h-template | 8 -------- 5 files changed, 6 insertions(+), 17 deletions(-) delete mode 100644 keymaps_h-template diff --git a/KeyboardConfig.h b/KeyboardConfig.h index 09252b5d..58cd5fb9 100644 --- a/KeyboardConfig.h +++ b/KeyboardConfig.h @@ -1,6 +1,8 @@ #pragma once #include "WS2812.h" +#include "generated/keymaps.h" + #define EEPROM_KEYMAP_LOCATION 0 #define MODEL01 true @@ -38,6 +40,9 @@ int right_rowpins[]= {8,9,10,11}; #define COLS 16 #define ROWS 4 +#define KEYMAPS 3 +#define NUMPAD_KEYMAP 2 +#define KEYMAP_LIST KEYMAP_QWERTY KEYMAP_GENERIC_FN2 KEYMAP_NUMPAD #endif diff --git a/KeyboardioFirmware.h b/KeyboardioFirmware.h index 469e2c45..99f8177c 100644 --- a/KeyboardioFirmware.h +++ b/KeyboardioFirmware.h @@ -35,6 +35,7 @@ char x; char y; byte matrixState[ROWS][COLS]; +static const Key keymaps[KEYMAPS][ROWS][COLS] = { KEYMAP_LIST }; long reporting_counter = 0; byte primary_keymap = 0; diff --git a/Makefile b/Makefile index 0f645b20..1ca84f59 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,6 @@ astyle: generate-keymaps: -rm generated/keymaps.h cd layouts && ( find . -type f |xargs -n 1 -I % sh -c 'perl ../tools/generate_keymaps.pl < % >> ../generated/keymaps.h' ) - cat keymaps_h-template >> generated/keymaps.h dirs: mkdir -p $(OUTPUT_PATH) diff --git a/generated/keymaps.h b/generated/keymaps.h index 2639e4f6..fc54a671 100644 --- a/generated/keymaps.h +++ b/generated/keymaps.h @@ -57,11 +57,3 @@ {Key_PageDn, Key_Z, Key_X, Key_M, Key_C, Key_V, Key_Esc, Key_Keymap0, Key_K, Key_L, Key_Comma, Key_Period, Key_Slash, Key_Minus},\ {Key_LGUI, Key_Backspace, Key_LShift, Key_LCtrl, Key_KeymapNext_Momentary, Key_skip, Key_skip, Key_skip, Key_skip, Key_KeymapNext_Momentary, Key_RCtrl, Key_RShift, Key_Space, Key_RAlt},\ }, -#define KEYMAPS 3 -#define NUMPAD_KEYMAP 2 -static const Key keymaps[KEYMAPS][ROWS][COLS] = { - KEYMAP_QWERTY - KEYMAP_GENERIC_FN2 - KEYMAP_NUMPAD -}; - diff --git a/keymaps_h-template b/keymaps_h-template deleted file mode 100644 index b09049a9..00000000 --- a/keymaps_h-template +++ /dev/null @@ -1,8 +0,0 @@ -#define KEYMAPS 3 -#define NUMPAD_KEYMAP 2 -static const Key keymaps[KEYMAPS][ROWS][COLS] = { - KEYMAP_QWERTY - KEYMAP_GENERIC_FN2 - KEYMAP_NUMPAD -}; -