From 55f603394ddc06dad76e165c587b3a1d720b7760 Mon Sep 17 00:00:00 2001 From: Kai Ryu Date: Thu, 3 Apr 2014 13:46:03 +0900 Subject: [PATCH 1/5] New branch for keymap-in-eeprom feature --- common.mk | 5 ++ common/bootmagic.c | 1 + common/eeconfig.c | 7 +++ common/keyboard.c | 5 ++ common/keymap_in_eeprom.c | 108 ++++++++++++++++++++++++++++++++++++++ common/keymap_in_eeprom.h | 68 ++++++++++++++++++++++++ 6 files changed, 194 insertions(+) create mode 100644 common/keymap_in_eeprom.c create mode 100644 common/keymap_in_eeprom.h diff --git a/common.mk b/common.mk index 2ca06daa..fb4ca939 100644 --- a/common.mk +++ b/common.mk @@ -64,6 +64,11 @@ ifdef KEYMAP_SECTION_ENABLE EXTRALDFLAGS = -Wl,-L$(TOP_DIR),-Tldscript_keymap_avr5.x endif +ifdef KEYMAP_IN_EEPROM_ENABLE + SRC += $(COMMON_DIR)/keymap_in_eeprom.c + OPT_DEFS += -DKEYMAP_IN_EEPROM_ENABLE +endif + # Version string OPT_DEFS += -DVERSION=$(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null) diff --git a/common/bootmagic.c b/common/bootmagic.c index 036d4904..311a02f2 100644 --- a/common/bootmagic.c +++ b/common/bootmagic.c @@ -30,6 +30,7 @@ void bootmagic(void) /* eeconfig clear */ if (bootmagic_scan_keycode(BOOTMAGIC_KEY_EEPROM_CLEAR)) { + eeconfig_disable(); eeconfig_init(); } diff --git a/common/eeconfig.c b/common/eeconfig.c index 5bd47dc6..d98cd61a 100644 --- a/common/eeconfig.c +++ b/common/eeconfig.c @@ -2,6 +2,7 @@ #include #include #include "eeconfig.h" +#include "keymap_in_eeprom.h" void eeconfig_init(void) { @@ -13,6 +14,9 @@ void eeconfig_init(void) #ifdef BACKLIGHT_ENABLE eeprom_write_byte(EECONFIG_BACKLIGHT, 0); #endif +#ifdef KEYMAP_IN_EEPROM_ENABLE + keymap_in_eeprom_init(); +#endif } void eeconfig_enable(void) @@ -23,6 +27,9 @@ void eeconfig_enable(void) void eeconfig_disable(void) { eeprom_write_word(EECONFIG_MAGIC, 0xFFFF); +#ifdef KEYMAP_IN_EEPROM_ENABLE + keymap_in_eeprom_disable(); +#endif } bool eeconfig_is_enabled(void) diff --git a/common/keyboard.c b/common/keyboard.c index 2b66f20a..20dfbca8 100644 --- a/common/keyboard.c +++ b/common/keyboard.c @@ -31,6 +31,7 @@ along with this program. If not, see . #include "bootmagic.h" #include "eeconfig.h" #include "backlight.h" +#include "keymap_in_eeprom.h" #ifdef MOUSEKEY_ENABLE # include "mousekey.h" #endif @@ -72,6 +73,10 @@ void keyboard_init(void) #ifdef BACKLIGHT_ENABLE backlight_init(); #endif + +#ifdef KEYMAP_IN_EEPROM_ENABLE + keymap_in_eeprom_init(); +#endif } /* diff --git a/common/keymap_in_eeprom.c b/common/keymap_in_eeprom.c new file mode 100644 index 00000000..875c52b4 --- /dev/null +++ b/common/keymap_in_eeprom.c @@ -0,0 +1,108 @@ +/* +Copyright 2013,2014 Kai Ryu + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include +#include +#include "eeconfig.h" +#include "keymap_in_eeprom.h" +#include "debug.h" + +#ifdef KEYMAP_IN_EEPROM_ENABLE + +void keymap_in_eeprom_init(void) { + if (!check_keymap_in_eeprom()) { + write_keymap_to_eeprom(); + } +} + +void keymap_in_eeprom_disable(void) { + eeprom_write_word(EECONFIG_KEYMAP_CHECKSUM, eeprom_read_word(EECONFIG_KEYMAP_CHECKSUM) + 1); +} + +bool check_keymap_in_eeprom(void) { + uint16_t checksum_in_eeprom = eeprom_read_word(EECONFIG_KEYMAP_CHECKSUM); + uint16_t checksum = EECONFIG_MAGIC_NUMBER; + for (uint16_t i = 0; i < KEYMAP_WORD_SIZE; i++) { + checksum += eeprom_read_word(EECONFIG_KEYMAP_FN_ACTIONS + i); + } +#ifdef DEBUG + eeprom_write_word(EECONFIG_KEYMAP_DEBUG, checksum); +#endif + return (checksum_in_eeprom == checksum); +} + +void write_keymap_to_eeprom(void) { + uint16_t checksum = EECONFIG_MAGIC_NUMBER; + const uint16_t *fn_actions = fn_actions_pointer(); + const uint8_t *keymaps = keymaps_pointer(); + // write fn_actions + if (fn_actions != NULL) { + uint16_t fn_actions_count_in_flash = fn_actions_count(); + for (uint16_t i = 0; i < FN_ACTIONS_COUNT; i++) { + uint16_t fn_action = 0; + if (i < fn_actions_count_in_flash) { + fn_action = pgm_read_word(fn_actions + i); + } + eeconfig_write_keymap_fn_action(i, fn_action); + checksum += fn_action; + } + } + // write keymaps + if (keymaps != NULL) { + uint16_t keys_count_in_flash = keys_count(); + for (uint16_t i = 0; i < KEYS_COUNT; i++) { + uint8_t keymap = 0; + if (i < keys_count_in_flash) { + keymap = pgm_read_byte(keymaps + i); + } + eeconfig_write_keymap_key_by_index(i, keymap); + uint16_t keymap_word = keymap; + if (i & 1) { + keymap_word = keymap << 8; + } + checksum += keymap_word; + } + } + // write checksum + eeprom_write_word(EECONFIG_KEYMAP_CHECKSUM, checksum); +} + +uint16_t eeconfig_read_keymap_fn_action(uint8_t index) { + return eeprom_read_word(EECONFIG_KEYMAP_FN_ACTIONS + index); +} + +void eeconfig_write_keymap_fn_action(uint8_t index, uint16_t fn_action) { + return eeprom_write_word(EECONFIG_KEYMAP_FN_ACTIONS + index, fn_action); +} + +uint8_t eeconfig_read_keymap_key(uint8_t layer, uint8_t row, uint8_t col) { + return eeprom_read_byte(EECONFIG_KEYMAP_KEYMAPS + KEY_OFFSET(layer, row, col)); +} + +void eeconfig_write_keymap_key(uint8_t layer, uint8_t row, uint8_t col, uint8_t key) { + return eeprom_write_byte(EECONFIG_KEYMAP_KEYMAPS + KEY_OFFSET(layer, row, col), key); +} + +uint8_t eeconfig_read_keymap_key_by_index(uint16_t index) { + return eeprom_read_byte(EECONFIG_KEYMAP_KEYMAPS + index); +} + +void eeconfig_write_keymap_key_by_index(uint16_t index, uint8_t key) { + return eeprom_write_byte(EECONFIG_KEYMAP_KEYMAPS + index, key); +} + +#endif diff --git a/common/keymap_in_eeprom.h b/common/keymap_in_eeprom.h new file mode 100644 index 00000000..a7fcb07b --- /dev/null +++ b/common/keymap_in_eeprom.h @@ -0,0 +1,68 @@ +/* +Copyright 2013,2014 Kai Ryu + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef KEYMAP_IN_EEPROM_H +#define KEYMAP_IN_EEPROM_H + +#ifdef KEYMAP_IN_EEPROM_ENABLE + +#include +#include + +#define EECONFIG_KEYMAP_IN_EEPROM 0x10 +#ifndef FN_ACTIONS_COUNT +#define FN_ACTIONS_COUNT 32 +#endif +#ifndef KEYMAPS_COUNT +#define KEYMAPS_COUNT 1 +#endif +#define KEYS_COUNT (KEYMAPS_COUNT * MATRIX_ROWS * MATRIX_COLS) + +typedef struct { + uint16_t checksum; + uint16_t fn_actions[FN_ACTIONS_COUNT]; + uint8_t keymaps[KEYMAPS_COUNT][MATRIX_ROWS][MATRIX_COLS]; +} keymap_in_eeprom_t; + +#define EECONFIG_KEYMAP_CHECKSUM (uint16_t *)(EECONFIG_KEYMAP_IN_EEPROM) +#define EECONFIG_KEYMAP_FN_ACTIONS (uint16_t *)(EECONFIG_KEYMAP_CHECKSUM + 1) +#define EECONFIG_KEYMAP_KEYMAPS (uint8_t *)(EECONFIG_KEYMAP_FN_ACTIONS + FN_ACTIONS_COUNT) +#define EECONFIG_KEYMAP_DEBUG (uint16_t *)(EECONFIG_KEYMAP_KEYMAPS + KEYS_COUNT) + +#define KEYMAP_SIZE (sizeof(uint16_t) * FN_ACTIONS_COUNT + sizeof(uint8_t) * KEYS_COUNT) +#define KEYMAP_WORD_SIZE ((KEYMAP_SIZE + 1) / 2) +#define KEY_OFFSET(layer, row, col) (layer * MATRIX_ROWS * MATRIX_COLS + row * MATRIX_COLS + col) + +void keymap_in_eeprom_init(void); +void keymap_in_eeprom_disable(void); +bool check_keymap_in_eeprom(void); +void write_keymap_to_eeprom(void); +uint8_t eeconfig_read_keymap_key(uint8_t layer, uint8_t row, uint8_t col); +void eeconfig_write_keymap_key(uint8_t layer, uint8_t row, uint8_t col, uint8_t key); +uint8_t eeconfig_read_keymap_key_by_index(uint16_t index); +void eeconfig_write_keymap_key_by_index(uint16_t index, uint8_t key); +uint16_t eeconfig_read_keymap_fn_action(uint8_t index); +void eeconfig_write_keymap_fn_action(uint8_t index, uint16_t fn_action); + +const uint8_t* keymaps_pointer(void); +const uint16_t* fn_actions_pointer(void); +uint16_t keys_count(void); +uint16_t fn_actions_count(void); + +#endif + +#endif From d8b992585e69c39bd22c50646caeb38ce0ba6710 Mon Sep 17 00:00:00 2001 From: Kai Ryu Date: Thu, 10 Apr 2014 15:55:11 +0900 Subject: [PATCH 2/5] Support for odd-byte keymap --- common/keymap_in_eeprom.c | 6 ++++-- common/keymap_in_eeprom.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/keymap_in_eeprom.c b/common/keymap_in_eeprom.c index 875c52b4..145b5e61 100644 --- a/common/keymap_in_eeprom.c +++ b/common/keymap_in_eeprom.c @@ -36,8 +36,10 @@ void keymap_in_eeprom_disable(void) { bool check_keymap_in_eeprom(void) { uint16_t checksum_in_eeprom = eeprom_read_word(EECONFIG_KEYMAP_CHECKSUM); uint16_t checksum = EECONFIG_MAGIC_NUMBER; - for (uint16_t i = 0; i < KEYMAP_WORD_SIZE; i++) { - checksum += eeprom_read_word(EECONFIG_KEYMAP_FN_ACTIONS + i); + for (uint16_t i = 0; i < KEYMAP_SIZE; i++) { + uint8_t byte = eeprom_read_byte((uint8_t *)EECONFIG_KEYMAP_FN_ACTIONS + i); + uint16_t word = (i & 1) ? byte << 8 : byte; + checksum += word; } #ifdef DEBUG eeprom_write_word(EECONFIG_KEYMAP_DEBUG, checksum); diff --git a/common/keymap_in_eeprom.h b/common/keymap_in_eeprom.h index a7fcb07b..769dfa2e 100644 --- a/common/keymap_in_eeprom.h +++ b/common/keymap_in_eeprom.h @@ -41,7 +41,7 @@ typedef struct { #define EECONFIG_KEYMAP_CHECKSUM (uint16_t *)(EECONFIG_KEYMAP_IN_EEPROM) #define EECONFIG_KEYMAP_FN_ACTIONS (uint16_t *)(EECONFIG_KEYMAP_CHECKSUM + 1) #define EECONFIG_KEYMAP_KEYMAPS (uint8_t *)(EECONFIG_KEYMAP_FN_ACTIONS + FN_ACTIONS_COUNT) -#define EECONFIG_KEYMAP_DEBUG (uint16_t *)(EECONFIG_KEYMAP_KEYMAPS + KEYS_COUNT) +#define EECONFIG_KEYMAP_DEBUG (uint16_t *)(EECONFIG_KEYMAP_CHECKSUM - 1) #define KEYMAP_SIZE (sizeof(uint16_t) * FN_ACTIONS_COUNT + sizeof(uint8_t) * KEYS_COUNT) #define KEYMAP_WORD_SIZE ((KEYMAP_SIZE + 1) / 2) From 0f3116255468cb89492072c775987b255d469d9e Mon Sep 17 00:00:00 2001 From: Kai Ryu Date: Thu, 10 Apr 2014 16:04:50 +0900 Subject: [PATCH 3/5] A sample implementation of keymap-in-eeprom --- doc/build.md | 1 + keyboard/gh60/Makefile | 7 ++++--- keyboard/gh60/Makefile.pjrc | 19 ++++--------------- keyboard/gh60/config.h | 4 ++++ keyboard/gh60/keymap_common.c | 22 +++++++++++++++++++++- keyboard/gh60/keymap_common.h | 1 + keyboard/gh60/keymap_poker.c | 10 ++++++++++ 7 files changed, 45 insertions(+), 19 deletions(-) diff --git a/doc/build.md b/doc/build.md index bfe5de9f..c7522e4d 100644 --- a/doc/build.md +++ b/doc/build.md @@ -133,6 +133,7 @@ Optional. Note that ***comment out*** to disable them. SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend #NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA #BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality + #KEYMAP_IN_EEPROM_ENABLE = yes # Read keymap from eeprom ### 3. Programmer Optional. Set proper command for your controller, bootloader and programmer. This command can be used with `make program`. Not needed if you use `FLIP`, `dfu-programmer` or `Teensy Loader`. diff --git a/keyboard/gh60/Makefile b/keyboard/gh60/Makefile index fd202c17..8a821e31 100644 --- a/keyboard/gh60/Makefile +++ b/keyboard/gh60/Makefile @@ -118,9 +118,10 @@ BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA +COMMAND_ENABLE = yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +KEYMAP_IN_EEPROM_ENABLE = yes # Read keymap from eeprom # Optimize size but this may cause error "relocation truncated to fit" diff --git a/keyboard/gh60/Makefile.pjrc b/keyboard/gh60/Makefile.pjrc index 9655ff65..723d4411 100644 --- a/keyboard/gh60/Makefile.pjrc +++ b/keyboard/gh60/Makefile.pjrc @@ -88,11 +88,12 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+5000) EXTRAKEY_ENABLE = yes # Audio control and System control(+600) -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend NKRO_ENABLE = yes # USB Nkey Rollover(+500) #PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support +KEYMAP_IN_EEPROM_ENABLE = yes # Read keymap from eeprom # Search Path @@ -102,15 +103,3 @@ VPATH += $(TOP_DIR) include $(TOP_DIR)/protocol/pjrc.mk include $(TOP_DIR)/common.mk include $(TOP_DIR)/rules.mk - -plain: OPT_DEFS += -DKEYMAP_PLAIN -plain: all - -poker: OPT_DEFS += -DKEYMAP_POKER -poker: all - -poker_set: OPT_DEFS += -DKEYMAP_POKER_SET -poker_set: all - -poker_bit: OPT_DEFS += -DKEYMAP_POKER_BIT -poker_bit: all diff --git a/keyboard/gh60/config.h b/keyboard/gh60/config.h index e9c0f436..4f7ad422 100644 --- a/keyboard/gh60/config.h +++ b/keyboard/gh60/config.h @@ -31,6 +31,10 @@ along with this program. If not, see . #define MATRIX_ROWS 5 #define MATRIX_COLS 14 +/* keymap in eeprom */ +#define FN_ACTIONS_COUNT 32 +#define KEYMAPS_COUNT 8 + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboard/gh60/keymap_common.c b/keyboard/gh60/keymap_common.c index 7b6379f6..53087379 100644 --- a/keyboard/gh60/keymap_common.c +++ b/keyboard/gh60/keymap_common.c @@ -20,11 +20,31 @@ along with this program. If not, see . /* translates key to keycode */ uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) { +#ifndef KEYMAP_IN_EEPROM_ENABLE return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); +#else + return eeconfig_read_keymap_key(layer, key.row, key.col); +#endif } /* translates Fn keycode to action */ action_t keymap_fn_to_action(uint8_t keycode) { - return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; + return (action_t) { +#ifndef KEYMAP_IN_EEPROM_ENABLE + .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) +#else + .code = eeconfig_read_keymap_fn_action(FN_INDEX(keycode)) +#endif + }; } + +#ifdef KEYMAP_IN_EEPROM_ENABLE +const uint8_t* keymaps_pointer(void) { + return (const uint8_t*)keymaps; +} + +const uint16_t* fn_actions_pointer(void) { + return fn_actions; +} +#endif diff --git a/keyboard/gh60/keymap_common.h b/keyboard/gh60/keymap_common.h index 896badd7..8e4bc3bf 100644 --- a/keyboard/gh60/keymap_common.h +++ b/keyboard/gh60/keymap_common.h @@ -28,6 +28,7 @@ along with this program. If not, see . #include "print.h" #include "debug.h" #include "keymap.h" +#include "keymap_in_eeprom.h" extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; diff --git a/keyboard/gh60/keymap_poker.c b/keyboard/gh60/keymap_poker.c index 7a612ee4..f0d0f963 100644 --- a/keyboard/gh60/keymap_poker.c +++ b/keyboard/gh60/keymap_poker.c @@ -102,3 +102,13 @@ const uint16_t PROGMEM fn_actions[] = { [7] = ACTION_DEFAULT_LAYER_SET(2), // set dvorak layout [8] = ACTION_DEFAULT_LAYER_SET(3), // set workman layout }; + +#ifdef KEYMAP_IN_EEPROM_ENABLE +uint16_t keys_count(void) { + return sizeof(keymaps) / sizeof(keymaps[0]) * MATRIX_ROWS * MATRIX_COLS; +} + +uint16_t fn_actions_count(void) { + return sizeof(fn_actions) / sizeof(fn_actions[0]); +} +#endif From 7cdfbab020446fe0446da0af1143ee5aedb050a5 Mon Sep 17 00:00:00 2001 From: Kai Ryu Date: Fri, 11 Apr 2014 12:12:03 +0900 Subject: [PATCH 4/5] Change logic of resetting keymap in eeprom --- common/bootmagic.c | 5 ++++- common/eeconfig.c | 7 ------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/common/bootmagic.c b/common/bootmagic.c index 311a02f2..0baff830 100644 --- a/common/bootmagic.c +++ b/common/bootmagic.c @@ -7,6 +7,7 @@ #include "keymap.h" #include "action_layer.h" #include "eeconfig.h" +#include "keymap_in_eeprom.h" #include "bootmagic.h" @@ -30,8 +31,10 @@ void bootmagic(void) /* eeconfig clear */ if (bootmagic_scan_keycode(BOOTMAGIC_KEY_EEPROM_CLEAR)) { - eeconfig_disable(); eeconfig_init(); +#ifdef KEYMAP_IN_EEPROM_ENABLE + write_keymap_to_eeprom(); +#endif } /* bootloader */ diff --git a/common/eeconfig.c b/common/eeconfig.c index d98cd61a..5bd47dc6 100644 --- a/common/eeconfig.c +++ b/common/eeconfig.c @@ -2,7 +2,6 @@ #include #include #include "eeconfig.h" -#include "keymap_in_eeprom.h" void eeconfig_init(void) { @@ -14,9 +13,6 @@ void eeconfig_init(void) #ifdef BACKLIGHT_ENABLE eeprom_write_byte(EECONFIG_BACKLIGHT, 0); #endif -#ifdef KEYMAP_IN_EEPROM_ENABLE - keymap_in_eeprom_init(); -#endif } void eeconfig_enable(void) @@ -27,9 +23,6 @@ void eeconfig_enable(void) void eeconfig_disable(void) { eeprom_write_word(EECONFIG_MAGIC, 0xFFFF); -#ifdef KEYMAP_IN_EEPROM_ENABLE - keymap_in_eeprom_disable(); -#endif } bool eeconfig_is_enabled(void) From c19d349622de9f8be6d946c895170936c8ded64d Mon Sep 17 00:00:00 2001 From: Kai Ryu Date: Fri, 11 Apr 2014 12:25:15 +0900 Subject: [PATCH 5/5] Remove unnecessary changes --- keyboard/gh60/Makefile.pjrc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/keyboard/gh60/Makefile.pjrc b/keyboard/gh60/Makefile.pjrc index 723d4411..ade03a77 100644 --- a/keyboard/gh60/Makefile.pjrc +++ b/keyboard/gh60/Makefile.pjrc @@ -103,3 +103,15 @@ VPATH += $(TOP_DIR) include $(TOP_DIR)/protocol/pjrc.mk include $(TOP_DIR)/common.mk include $(TOP_DIR)/rules.mk + +plain: OPT_DEFS += -DKEYMAP_PLAIN +plain: all + +poker: OPT_DEFS += -DKEYMAP_POKER +poker: all + +poker_set: OPT_DEFS += -DKEYMAP_POKER_SET +poker_set: all + +poker_bit: OPT_DEFS += -DKEYMAP_POKER_BIT +poker_bit: all