From 7b31d1b9d9f0d9c7d1e4b553e583381552cd8778 Mon Sep 17 00:00:00 2001 From: tmk Date: Sat, 25 Jun 2016 23:23:22 +0900 Subject: [PATCH] Remove keymap read code from project directories --- converter/adb_usb/Makefile | 3 +- converter/adb_usb/Makefile.rev1 | 3 +- converter/adb_usb/Makefile.teensy | 3 +- converter/adb_usb/config.h | 4 --- converter/adb_usb/keymap_common.c | 30 ----------------- converter/adb_usb/keymap_common.h | 5 --- converter/adb_usb/keymap_plain.c | 2 +- converter/ibm4704_usb/Makefile | 3 +- converter/ibm4704_usb/keymap_common.c | 30 ----------------- converter/ibm4704_usb/keymap_common.h | 6 ---- converter/m0110_usb/Makefile | 1 - converter/m0110_usb/Makefile.teensy | 1 - converter/m0110_usb/Makefile.tmk_rev1 | 1 - converter/m0110_usb/Makefile.tmk_rev2 | 1 - converter/m0110_usb/keymap_common.c | 37 --------------------- converter/m0110_usb/keymap_common.h | 5 --- converter/news_usb/keymap.c | 23 ++----------- converter/next_usb/keymap.c | 17 ++-------- converter/pc98_usb/keymap.c | 40 ++--------------------- converter/ps2_usb/Makefile | 3 +- converter/ps2_usb/Makefile.mbed | 1 - converter/ps2_usb/Makefile.pjrc | 3 +- converter/ps2_usb/Makefile.tmk_rev1 | 3 +- converter/ps2_usb/Makefile.tmk_rev2 | 3 +- converter/ps2_usb/Makefile.vusb | 3 +- converter/ps2_usb/keymap_common.c | 31 ------------------ converter/ps2_usb/keymap_common.h | 5 --- converter/sun_usb/keymap.c | 23 ++----------- converter/sun_usb/keymap_sun3.c | 17 ---------- converter/terminal_usb/keymap.c | 23 ++----------- converter/usb_usb/Makefile | 4 +-- converter/usb_usb/keymap_common.c | 31 ------------------ converter/usb_usb/keymap_common.h | 4 --- converter/x68k_usb/keymap.c | 18 ++-------- converter/xt_usb/Makefile | 3 +- converter/xt_usb/keymap_common.c | 31 ------------------ converter/xt_usb/keymap_common.h | 4 --- converter/xt_usb/keymap_jis.c | 2 +- converter/xt_usb/keymap_plain.c | 2 +- converter/xt_usb/keymap_spacefn.c | 2 +- keyboard/alps64/Makefile | 1 - keyboard/alps64/actionmap_hasu.c | 1 - keyboard/alps64/actionmap_plain.c | 1 - keyboard/alps64/keymap_common.c | 30 ----------------- keyboard/alps64/keymap_common.h | 5 --- keyboard/gh60/Makefile | 3 +- keyboard/gh60/keymap_common.c | 30 ----------------- keyboard/gh60/keymap_common.h | 5 --- keyboard/hhkb/Makefile | 3 +- keyboard/hhkb/Makefile.pjrc | 3 +- keyboard/hhkb/Makefile.rn42 | 3 +- keyboard/hhkb/keymap_common.c | 33 ------------------- keyboard/hhkb/keymap_common.h | 4 --- keyboard/infinity/Makefile | 1 - keyboard/infinity/keymap_common.c | 30 ----------------- keyboard/infinity/keymap_common.h | 4 --- keyboard/infinity_chibios/Makefile | 1 - keyboard/infinity_chibios/keymap_common.c | 30 ----------------- keyboard/infinity_chibios/keymap_common.h | 4 --- keyboard/onekey/keymap.c | 29 ---------------- keyboard/stm32_f103_onekey/keymap_plain.c | 2 +- keyboard/teensy_lc_onekey/keymap_plain.c | 2 +- 62 files changed, 36 insertions(+), 620 deletions(-) delete mode 100644 converter/adb_usb/keymap_common.c delete mode 100644 converter/ibm4704_usb/keymap_common.c delete mode 100644 converter/m0110_usb/keymap_common.c delete mode 100644 converter/ps2_usb/keymap_common.c delete mode 100644 converter/usb_usb/keymap_common.c delete mode 100644 converter/xt_usb/keymap_common.c delete mode 100644 keyboard/alps64/keymap_common.c delete mode 100644 keyboard/gh60/keymap_common.c delete mode 100644 keyboard/hhkb/keymap_common.c delete mode 100644 keyboard/infinity/keymap_common.c delete mode 100644 keyboard/infinity_chibios/keymap_common.c diff --git a/converter/adb_usb/Makefile b/converter/adb_usb/Makefile index 76e10950..21fc26b5 100644 --- a/converter/adb_usb/Makefile +++ b/converter/adb_usb/Makefile @@ -48,8 +48,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # project specific files -SRC = keymap_common.c \ - matrix.c \ +SRC = matrix.c \ led.c \ adb.c diff --git a/converter/adb_usb/Makefile.rev1 b/converter/adb_usb/Makefile.rev1 index 1cd539b6..c986210b 100644 --- a/converter/adb_usb/Makefile.rev1 +++ b/converter/adb_usb/Makefile.rev1 @@ -48,8 +48,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # project specific files -SRC = keymap_common.c \ - matrix.c \ +SRC = matrix.c \ led.c \ adb.c diff --git a/converter/adb_usb/Makefile.teensy b/converter/adb_usb/Makefile.teensy index d97f0eb3..59eaad51 100644 --- a/converter/adb_usb/Makefile.teensy +++ b/converter/adb_usb/Makefile.teensy @@ -48,8 +48,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # project specific files -SRC = keymap_common.c \ - matrix.c \ +SRC = matrix.c \ led.c \ adb.c diff --git a/converter/adb_usb/config.h b/converter/adb_usb/config.h index 5ce5c221..3500188d 100644 --- a/converter/adb_usb/config.h +++ b/converter/adb_usb/config.h @@ -40,10 +40,6 @@ along with this program. If not, see . #define LOCKING_RESYNC_ENABLE -/* legacy keymap support */ -#define USE_LEGACY_KEYMAP - - /* ADB port setting */ #define ADB_PORT PORTD #define ADB_PIN PIND diff --git a/converter/adb_usb/keymap_common.c b/converter/adb_usb/keymap_common.c deleted file mode 100644 index 55a13793..00000000 --- a/converter/adb_usb/keymap_common.c +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -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 "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* 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)]) }; -} diff --git a/converter/adb_usb/keymap_common.h b/converter/adb_usb/keymap_common.h index e9d5b651..49581d79 100644 --- a/converter/adb_usb/keymap_common.h +++ b/converter/adb_usb/keymap_common.h @@ -19,7 +19,6 @@ along with this program. If not, see . #include #include -#include #include "keycode.h" #include "action.h" #include "action_macro.h" @@ -29,10 +28,6 @@ along with this program. If not, see . #include "keymap.h" -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const action_t fn_actions[]; - - /* Common layout: ANSI+ISO * ,---. .---------------. ,---------------. ,---------------. ,-----------. ,---------------. * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| diff --git a/converter/adb_usb/keymap_plain.c b/converter/adb_usb/keymap_plain.c index 2f11f86a..b7a80f57 100644 --- a/converter/adb_usb/keymap_plain.c +++ b/converter/adb_usb/keymap_plain.c @@ -36,7 +36,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { +const action_t PROGMEM fn_actions[] = { [0] = ACTION_LAYER_TAP_KEY(1, KC_GRV), [1] = ACTION_LAYER_TAP_KEY(1, KC_BSLS), }; diff --git a/converter/ibm4704_usb/Makefile b/converter/ibm4704_usb/Makefile index 79f17ec0..c73bcfd5 100644 --- a/converter/ibm4704_usb/Makefile +++ b/converter/ibm4704_usb/Makefile @@ -8,8 +8,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # project specific files -SRC = keymap_common.c \ - matrix.c \ +SRC = matrix.c \ led.c \ protocol/ibm4704.c diff --git a/converter/ibm4704_usb/keymap_common.c b/converter/ibm4704_usb/keymap_common.c deleted file mode 100644 index 55a13793..00000000 --- a/converter/ibm4704_usb/keymap_common.c +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -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 "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* 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)]) }; -} diff --git a/converter/ibm4704_usb/keymap_common.h b/converter/ibm4704_usb/keymap_common.h index 55e26de2..ea0ec942 100644 --- a/converter/ibm4704_usb/keymap_common.h +++ b/converter/ibm4704_usb/keymap_common.h @@ -19,7 +19,6 @@ along with this program. If not, see . #include #include -#include #include "keycode.h" #include "action.h" #include "action_macro.h" @@ -29,11 +28,6 @@ along with this program. If not, see . #include "keymap.h" -// 32*8(256) byte array which converts PS/2 code into USB code -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const action_t fn_actions[]; - - /* 107-key */ #define KEYMAP( \ K46,K64, K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, K6A,K6B,K6C, K47,K48,K49,K4A, \ diff --git a/converter/m0110_usb/Makefile b/converter/m0110_usb/Makefile index e8364563..5007824d 100644 --- a/converter/m0110_usb/Makefile +++ b/converter/m0110_usb/Makefile @@ -10,7 +10,6 @@ TARGET_DIR = . # keyboard dependent files SRC = matrix.c \ led.c \ - keymap_common.c \ m0110.c # To use own keymap file run make like: make keymap=hasu diff --git a/converter/m0110_usb/Makefile.teensy b/converter/m0110_usb/Makefile.teensy index 394b6605..d08c3f44 100644 --- a/converter/m0110_usb/Makefile.teensy +++ b/converter/m0110_usb/Makefile.teensy @@ -10,7 +10,6 @@ TARGET_DIR = . # keyboard dependent files SRC = matrix.c \ led.c \ - keymap_common.c \ m0110.c # To use own keymap file run make like: make keymap=hasu diff --git a/converter/m0110_usb/Makefile.tmk_rev1 b/converter/m0110_usb/Makefile.tmk_rev1 index f36fcc4b..cf10c788 100644 --- a/converter/m0110_usb/Makefile.tmk_rev1 +++ b/converter/m0110_usb/Makefile.tmk_rev1 @@ -10,7 +10,6 @@ TARGET_DIR = . # keyboard dependent files SRC = matrix.c \ led.c \ - keymap_common.c \ m0110.c # To use own keymap file run make like: make keymap=hasu diff --git a/converter/m0110_usb/Makefile.tmk_rev2 b/converter/m0110_usb/Makefile.tmk_rev2 index e8364563..5007824d 100644 --- a/converter/m0110_usb/Makefile.tmk_rev2 +++ b/converter/m0110_usb/Makefile.tmk_rev2 @@ -10,7 +10,6 @@ TARGET_DIR = . # keyboard dependent files SRC = matrix.c \ led.c \ - keymap_common.c \ m0110.c # To use own keymap file run make like: make keymap=hasu diff --git a/converter/m0110_usb/keymap_common.c b/converter/m0110_usb/keymap_common.c deleted file mode 100644 index 4ac2d717..00000000 --- a/converter/m0110_usb/keymap_common.c +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2011,2012,2014 Jun Wako - -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 "action.h" -#include "keycode.h" -#include "keymap.h" -#include "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* translates Fn index to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - action_t action; - action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]); - return action; -} diff --git a/converter/m0110_usb/keymap_common.h b/converter/m0110_usb/keymap_common.h index 42df5cce..4f7e88fb 100644 --- a/converter/m0110_usb/keymap_common.h +++ b/converter/m0110_usb/keymap_common.h @@ -15,15 +15,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include -#include #include "keycode.h" #include "keymap.h" -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const action_t fn_actions[]; - - /* Common layout for M0110 and M0110A * This keymap works with both keyboards. As you can see, the M0110A is * a superset of M0110 keyboard, only one exception is 'Enter'(34) of M0110 diff --git a/converter/news_usb/keymap.c b/converter/news_usb/keymap.c index 058f2914..5e6c2b5d 100644 --- a/converter/news_usb/keymap.c +++ b/converter/news_usb/keymap.c @@ -17,7 +17,6 @@ along with this program. If not, see . #include #include -#include #include "keycode.h" #include "util.h" #include "keymap.h" @@ -56,7 +55,7 @@ along with this program. If not, see . // Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. -static const uint8_t PROGMEM fn_layer[] = { +const uint8_t PROGMEM fn_layer[] = { 0, // Fn0 0, // Fn1 0, // Fn2 @@ -69,7 +68,7 @@ static const uint8_t PROGMEM fn_layer[] = { // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. // See layer.c for details. -static const uint8_t PROGMEM fn_keycode[] = { +const uint8_t PROGMEM fn_keycode[] = { KC_NO, // Fn0 KC_NO, // Fn1 KC_NO, // Fn2 @@ -81,7 +80,7 @@ static const uint8_t PROGMEM fn_keycode[] = { }; -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: default * ,---. ,------------------------, ,------------------------. ,---------. * |Pow| | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10| | F11| F12| ,-----------. @@ -107,19 +106,3 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LALT,CAPS,LALT, SPC, ERAS, RALT,RGUI,RCTL, PGDN, TAB, LEFT,DOWN,RGHT ), }; - - -uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) -{ - return pgm_read_byte(&keymaps[(layer)][(row)][(col)]); -} - -uint8_t keymap_fn_layer(uint8_t index) -{ - return pgm_read_byte(&fn_layer[index]); -} - -uint8_t keymap_fn_keycode(uint8_t index) -{ - return pgm_read_byte(&fn_keycode[index]); -} diff --git a/converter/next_usb/keymap.c b/converter/next_usb/keymap.c index 3f2131aa..90700da5 100644 --- a/converter/next_usb/keymap.c +++ b/converter/next_usb/keymap.c @@ -50,7 +50,6 @@ POSSIBILITY OF SUCH DAMAGE. #include #include -#include #include "keycode.h" #include "print.h" #include "debug.h" @@ -59,7 +58,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "keycode.h" // 32*8(256) byte array which converts PS/2 code into USB code -static const action_t PROGMEM fn_actions[] = { +const action_t PROGMEM fn_actions[] = { ACTION_LAYER_MOMENTARY(1), // FN0 - left command key ACTION_LAYER_MOMENTARY(1), // FN1 - right command key ACTION_KEY(KC_BSLS), // FN2 - number pad slash & backslash @@ -116,7 +115,7 @@ static const action_t PROGMEM fn_actions[] = { } -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: default * ,-----------------------------------------------------------. ,-----------. ,---------------. @@ -163,15 +162,3 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* 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)]) }; -} diff --git a/converter/pc98_usb/keymap.c b/converter/pc98_usb/keymap.c index c9ea5b0b..e56a72f1 100644 --- a/converter/pc98_usb/keymap.c +++ b/converter/pc98_usb/keymap.c @@ -17,7 +17,6 @@ along with this program. If not, see . #include #include -#include #include "keycode.h" #include "action.h" #include "action_macro.h" @@ -72,7 +71,7 @@ along with this program. If not, see . -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* ,---------------------------------------------------------------. | 60| 61| 62| 63| 64| 65| 66| 67| 68| 69| 6A| 6B| 36| 37| 3F| 3E| @@ -114,7 +113,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LGUI, LALT, LCTL, LSFT, SPC, SPC, RALT ), }; -static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {}; /* * Macro definition @@ -163,7 +161,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) /* * Fn actions */ -static const action_t PROGMEM fn_actions[] = { +const action_t PROGMEM fn_actions[] = { ACTION_LAYER_TAP_TOGGLE(0), // FN0 ACTION_LAYER_TAP_KEY(1, KC_SLASH), // FN1 ACTION_LAYER_TAP_KEY(2, KC_SCLN), // FN2 @@ -172,37 +170,3 @@ static const action_t PROGMEM fn_actions[] = { ACTION_MACRO(RBRACKET), // FN5 ACTION_MACRO(DUMMY), // FN6 }; - - - - - - -/* - * No need to edit. - */ -#define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0])) -#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0])) - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - if (layer < KEYMAPS_SIZE) { - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); - } else { - // fall back to layer 0 - return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]); - } -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - action_t action; - if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) { - action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]); - } else { - action.code = ACTION_NO; - } - return action; -} diff --git a/converter/ps2_usb/Makefile b/converter/ps2_usb/Makefile index 51b22256..dd034264 100644 --- a/converter/ps2_usb/Makefile +++ b/converter/ps2_usb/Makefile @@ -11,8 +11,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # project specific files -SRC = keymap_common.c \ - matrix.c \ +SRC = matrix.c \ led.c ifdef KEYMAP diff --git a/converter/ps2_usb/Makefile.mbed b/converter/ps2_usb/Makefile.mbed index bbd9bd45..9ca9f5fa 100644 --- a/converter/ps2_usb/Makefile.mbed +++ b/converter/ps2_usb/Makefile.mbed @@ -10,7 +10,6 @@ OBJDIR = ./build OBJECTS = \ $(OBJDIR)/protocol/ps2_busywait.o \ $(OBJDIR)/protocol/ps2_io_mbed.o \ - $(OBJDIR)/./keymap_common.o \ $(OBJDIR)/./matrix.o \ $(OBJDIR)/./led.o \ $(OBJDIR)/./main.o diff --git a/converter/ps2_usb/Makefile.pjrc b/converter/ps2_usb/Makefile.pjrc index 64319aca..88ee387d 100644 --- a/converter/ps2_usb/Makefile.pjrc +++ b/converter/ps2_usb/Makefile.pjrc @@ -8,8 +8,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # keyboard dependent files -SRC = keymap_common.c \ - matrix.c \ +SRC = matrix.c \ led.c ifdef KEYMAP diff --git a/converter/ps2_usb/Makefile.tmk_rev1 b/converter/ps2_usb/Makefile.tmk_rev1 index 6aaef499..644845f9 100644 --- a/converter/ps2_usb/Makefile.tmk_rev1 +++ b/converter/ps2_usb/Makefile.tmk_rev1 @@ -12,8 +12,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # project specific files -SRC = keymap_common.c \ - matrix.c \ +SRC = matrix.c \ led.c ifdef KEYMAP diff --git a/converter/ps2_usb/Makefile.tmk_rev2 b/converter/ps2_usb/Makefile.tmk_rev2 index 5049a227..83243280 100644 --- a/converter/ps2_usb/Makefile.tmk_rev2 +++ b/converter/ps2_usb/Makefile.tmk_rev2 @@ -12,8 +12,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # project specific files -SRC = keymap_common.c \ - matrix.c \ +SRC = matrix.c \ led.c ifdef KEYMAP diff --git a/converter/ps2_usb/Makefile.vusb b/converter/ps2_usb/Makefile.vusb index 1f2c209a..79c11639 100644 --- a/converter/ps2_usb/Makefile.vusb +++ b/converter/ps2_usb/Makefile.vusb @@ -8,8 +8,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # keyboard dependent files -SRC = keymap_common.c \ - matrix.c \ +SRC = matrix.c \ led.c ifdef KEYMAP diff --git a/converter/ps2_usb/keymap_common.c b/converter/ps2_usb/keymap_common.c deleted file mode 100644 index e344fb41..00000000 --- a/converter/ps2_usb/keymap_common.c +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -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 "keymap_common.h" -#include "progmem.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* 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)]) }; -} diff --git a/converter/ps2_usb/keymap_common.h b/converter/ps2_usb/keymap_common.h index a24fa756..6e612e60 100644 --- a/converter/ps2_usb/keymap_common.h +++ b/converter/ps2_usb/keymap_common.h @@ -28,11 +28,6 @@ along with this program. If not, see . #include "keymap.h" -// 32*8(256) byte array which converts PS/2 code into USB code -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const action_t fn_actions[]; - - /* All keys */ #define KEYMAP_ALL( \ K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ diff --git a/converter/sun_usb/keymap.c b/converter/sun_usb/keymap.c index 3d724a52..f94fe5c7 100644 --- a/converter/sun_usb/keymap.c +++ b/converter/sun_usb/keymap.c @@ -17,7 +17,6 @@ along with this program. If not, see . #include #include -#include #include "keycode.h" #include "util.h" #include "keymap.h" @@ -87,7 +86,7 @@ along with this program. If not, see . // Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. -static const uint8_t PROGMEM fn_layer[] = { +const uint8_t PROGMEM fn_layer[] = { 2, // Fn0 3, // Fn1 4, // Fn2 @@ -100,7 +99,7 @@ static const uint8_t PROGMEM fn_layer[] = { // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. // See layer.c for details. -static const uint8_t PROGMEM fn_keycode[] = { +const uint8_t PROGMEM fn_keycode[] = { KC_NO, // Fn0 KC_SCLN, // Fn1 KC_SLSH, // Fn2 @@ -112,7 +111,7 @@ static const uint8_t PROGMEM fn_keycode[] = { }; -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* KEYMAP( HELP, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12, PSCR,SLCK,PAUS, MUTE,VOLD,VOLU,PWR, @@ -174,19 +173,3 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { CAPS,LALT,LGUI, BTN1, RGUI,RALT,NO, LEFT,DOWN,RGHT ), }; - - -uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) -{ - return pgm_read_byte(&keymaps[(layer)][(row)][(col)]); -} - -uint8_t keymap_fn_layer(uint8_t index) -{ - return pgm_read_byte(&fn_layer[index]); -} - -uint8_t keymap_fn_keycode(uint8_t index) -{ - return pgm_read_byte(&fn_keycode[index]); -} diff --git a/converter/sun_usb/keymap_sun3.c b/converter/sun_usb/keymap_sun3.c index 273cd944..217aa79a 100644 --- a/converter/sun_usb/keymap_sun3.c +++ b/converter/sun_usb/keymap_sun3.c @@ -17,7 +17,6 @@ along with this program. If not, see . #include #include -#include #include "keycode.h" #include "util.h" #include "keymap.h" @@ -155,19 +154,3 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), */ }; - - -uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) -{ - return pgm_read_byte(&keymaps[(layer)][(row)][(col)]); -} - -uint8_t keymap_fn_layer(uint8_t index) -{ - return pgm_read_byte(&fn_layer[index]); -} - -uint8_t keymap_fn_keycode(uint8_t index) -{ - return pgm_read_byte(&fn_keycode[index]); -} diff --git a/converter/terminal_usb/keymap.c b/converter/terminal_usb/keymap.c index 8ca66b5e..5a3ee6ff 100644 --- a/converter/terminal_usb/keymap.c +++ b/converter/terminal_usb/keymap.c @@ -17,7 +17,6 @@ along with this program. If not, see . #include #include -#include #include "keycode.h" #include "print.h" #include "debug.h" @@ -102,7 +101,7 @@ along with this program. If not, see . } // Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. -static const uint8_t PROGMEM fn_layer[] = { +const uint8_t PROGMEM fn_layer[] = { 0, // Fn0 0, // Fn1 0, // Fn2 @@ -115,7 +114,7 @@ static const uint8_t PROGMEM fn_layer[] = { // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. // See layer.c for details. -static const uint8_t PROGMEM fn_keycode[] = { +const uint8_t PROGMEM fn_keycode[] = { KC_NO, // Fn0 KC_NO, // Fn1 KC_NO, // Fn2 @@ -127,7 +126,7 @@ static const uint8_t PROGMEM fn_keycode[] = { }; -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: default * ,---. ,---------------. ,---------------. ,---------------. ,-----------. * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| @@ -198,19 +197,3 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), */ }; - - -uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) -{ - return pgm_read_byte(&keymaps[(layer)][(row)][(col)]); -} - -uint8_t keymap_fn_layer(uint8_t index) -{ - return pgm_read_byte(&fn_layer[index]); -} - -uint8_t keymap_fn_keycode(uint8_t index) -{ - return pgm_read_byte(&fn_keycode[index]); -} diff --git a/converter/usb_usb/Makefile b/converter/usb_usb/Makefile index 5abb49d7..a4ac27b2 100644 --- a/converter/usb_usb/Makefile +++ b/converter/usb_usb/Makefile @@ -108,9 +108,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 #OPT_DEFS += -DNO_ACTION_LAYER #OPT_DEFS += -DNO_ACTION_MACRO -SRC = \ - keymap_common.c \ - usb_usb.cpp \ +SRC = usb_usb.cpp \ main.cpp ifdef KEYMAP diff --git a/converter/usb_usb/keymap_common.c b/converter/usb_usb/keymap_common.c deleted file mode 100644 index 8ab5ba92..00000000 --- a/converter/usb_usb/keymap_common.c +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2014 Jun Wako - -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 "keymap_common.h" -#include "progmem.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* 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)]) }; -} diff --git a/converter/usb_usb/keymap_common.h b/converter/usb_usb/keymap_common.h index a3234f5b..3284264f 100644 --- a/converter/usb_usb/keymap_common.h +++ b/converter/usb_usb/keymap_common.h @@ -28,10 +28,6 @@ along with this program. If not, see . #include "keymap.h" -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const action_t fn_actions[]; - - /* ,---------------. ,---------------. ,---------------. * |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24| * ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------. diff --git a/converter/x68k_usb/keymap.c b/converter/x68k_usb/keymap.c index 836752bf..4d6a1261 100644 --- a/converter/x68k_usb/keymap.c +++ b/converter/x68k_usb/keymap.c @@ -17,7 +17,6 @@ along with this program. If not, see . #include #include -#include #include "keycode.h" #include "action.h" #include "util.h" @@ -72,7 +71,7 @@ along with this program. If not, see . } -static const uint16_t fn_actions[] PROGMEM = { +const action_t fn_actions[] PROGMEM = { [0] = ACTION_FUNCTION(0), // toggle all LEDs }; @@ -92,7 +91,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) } -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* X68000 Keyboard Scan codes ,---. ,---. ,-------------------, ,-------------------. ,-----------. ,---------------. | 61| | 62| | 63| 64| 65| 66| 67| | 68| 69| 6A| 6B| 6C| | 5A| 5B| 5C| | 5D| 52| 53| 54| @@ -128,16 +127,3 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LGUI,LALT,MHEN, SPC, HENK,KANA,APP, ZKHK, F14, F15, P0, PCMM,PDOT ), }; - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* 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)]) }; -} diff --git a/converter/xt_usb/Makefile b/converter/xt_usb/Makefile index cd8230cb..6fc29cbf 100644 --- a/converter/xt_usb/Makefile +++ b/converter/xt_usb/Makefile @@ -11,8 +11,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # project specific files -SRC = keymap_common.c \ - matrix.c \ +SRC = matrix.c \ led.c ifdef KEYMAP diff --git a/converter/xt_usb/keymap_common.c b/converter/xt_usb/keymap_common.c deleted file mode 100644 index e344fb41..00000000 --- a/converter/xt_usb/keymap_common.c +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -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 "keymap_common.h" -#include "progmem.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* 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)]) }; -} diff --git a/converter/xt_usb/keymap_common.h b/converter/xt_usb/keymap_common.h index b9de6a86..9953c938 100644 --- a/converter/xt_usb/keymap_common.h +++ b/converter/xt_usb/keymap_common.h @@ -28,10 +28,6 @@ along with this program. If not, see . #include "keymap.h" -// 32*8(256) byte array which converts PS/2 code into USB code -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const uint16_t fn_actions[]; - /* All keys */ #define KEYMAP_ALL( \ K00, K02,K03,K04,K05,K06,K07,K08,K09,K0A,K0B,K0C,K0D, K0E,K0F,K0G, \ diff --git a/converter/xt_usb/keymap_jis.c b/converter/xt_usb/keymap_jis.c index 02585150..b430b907 100644 --- a/converter/xt_usb/keymap_jis.c +++ b/converter/xt_usb/keymap_jis.c @@ -30,5 +30,5 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { +const action_t PROGMEM fn_actions[] = { }; diff --git a/converter/xt_usb/keymap_plain.c b/converter/xt_usb/keymap_plain.c index 51b2fddb..ecb13d7d 100644 --- a/converter/xt_usb/keymap_plain.c +++ b/converter/xt_usb/keymap_plain.c @@ -28,5 +28,5 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { +const action_t PROGMEM fn_actions[] = { }; diff --git a/converter/xt_usb/keymap_spacefn.c b/converter/xt_usb/keymap_spacefn.c index bffd2bc6..8f087a85 100644 --- a/converter/xt_usb/keymap_spacefn.c +++ b/converter/xt_usb/keymap_spacefn.c @@ -54,7 +54,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { +const action_t PROGMEM fn_actions[] = { [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde }; diff --git a/keyboard/alps64/Makefile b/keyboard/alps64/Makefile index c82c126b..97d23ae0 100644 --- a/keyboard/alps64/Makefile +++ b/keyboard/alps64/Makefile @@ -120,7 +120,6 @@ ifdef ACTIONMAP_ENABLE KEYMAP_FILE = actionmap else KEYMAP_FILE = keymap - SRC := keymap_common.c $(SRC) endif ifdef KEYMAP SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC) diff --git a/keyboard/alps64/actionmap_hasu.c b/keyboard/alps64/actionmap_hasu.c index 4259720d..5eb43421 100644 --- a/keyboard/alps64/actionmap_hasu.c +++ b/keyboard/alps64/actionmap_hasu.c @@ -1,4 +1,3 @@ -#include #include "actionmap.h" #include "action_code.h" #include "actionmap_common.h" diff --git a/keyboard/alps64/actionmap_plain.c b/keyboard/alps64/actionmap_plain.c index de8fa992..58ffbaaa 100644 --- a/keyboard/alps64/actionmap_plain.c +++ b/keyboard/alps64/actionmap_plain.c @@ -1,4 +1,3 @@ -#include #include "actionmap.h" #include "action_code.h" #include "actionmap_common.h" diff --git a/keyboard/alps64/keymap_common.c b/keyboard/alps64/keymap_common.c deleted file mode 100644 index fdb1769e..00000000 --- a/keyboard/alps64/keymap_common.c +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -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 "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* 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)]) }; -} diff --git a/keyboard/alps64/keymap_common.h b/keyboard/alps64/keymap_common.h index bfd6ccbd..17418783 100644 --- a/keyboard/alps64/keymap_common.h +++ b/keyboard/alps64/keymap_common.h @@ -19,7 +19,6 @@ along with this program. If not, see . #include #include -#include #include "keycode.h" #include "action.h" #include "action_macro.h" @@ -30,10 +29,6 @@ along with this program. If not, see . #include "keymap.h" -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const action_t fn_actions[]; - - /* Alps64 keymap definition macro */ #define KEYMAP( \ K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K26, K27, \ diff --git a/keyboard/gh60/Makefile b/keyboard/gh60/Makefile index 083b87c3..b72019b1 100644 --- a/keyboard/gh60/Makefile +++ b/keyboard/gh60/Makefile @@ -48,8 +48,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # project specific files -SRC = keymap_common.c \ - matrix.c \ +SRC = matrix.c \ led.c ifdef KEYMAP diff --git a/keyboard/gh60/keymap_common.c b/keyboard/gh60/keymap_common.c deleted file mode 100644 index fdb1769e..00000000 --- a/keyboard/gh60/keymap_common.c +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -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 "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* 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)]) }; -} diff --git a/keyboard/gh60/keymap_common.h b/keyboard/gh60/keymap_common.h index 471905e7..7dbdf4b9 100644 --- a/keyboard/gh60/keymap_common.h +++ b/keyboard/gh60/keymap_common.h @@ -19,7 +19,6 @@ along with this program. If not, see . #include #include -#include #include "keycode.h" #include "action.h" #include "action_macro.h" @@ -30,10 +29,6 @@ along with this program. If not, see . #include "keymap.h" -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const action_t fn_actions[]; - - /* GH60 keymap definition macro * K2C, K31 and K3C are extra keys for ISO */ diff --git a/keyboard/hhkb/Makefile b/keyboard/hhkb/Makefile index 5a179bd2..8e15df19 100644 --- a/keyboard/hhkb/Makefile +++ b/keyboard/hhkb/Makefile @@ -49,8 +49,7 @@ TARGET_DIR = . # List C source files here. (C dependencies are automatically generated.) -SRC += keymap_common.c \ - matrix.c \ +SRC += matrix.c \ led.c CONFIG_H = config.h diff --git a/keyboard/hhkb/Makefile.pjrc b/keyboard/hhkb/Makefile.pjrc index 7d0f8c3a..e2d3a570 100644 --- a/keyboard/hhkb/Makefile.pjrc +++ b/keyboard/hhkb/Makefile.pjrc @@ -13,8 +13,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # keyboard dependent files -SRC = keymap_common.c \ - matrix.c \ +SRC = matrix.c \ led.c ifdef KEYMAP diff --git a/keyboard/hhkb/Makefile.rn42 b/keyboard/hhkb/Makefile.rn42 index 8cb44352..aae99ee9 100644 --- a/keyboard/hhkb/Makefile.rn42 +++ b/keyboard/hhkb/Makefile.rn42 @@ -49,8 +49,7 @@ TARGET_DIR = . # List C source files here. (C dependencies are automatically generated.) -SRC += keymap_common.c \ - matrix.c \ +SRC += matrix.c \ led.c CONFIG_H = config_rn42.h diff --git a/keyboard/hhkb/keymap_common.c b/keyboard/hhkb/keymap_common.c deleted file mode 100644 index e938fb62..00000000 --- a/keyboard/hhkb/keymap_common.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -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 "action.h" -#include -#include "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* 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)]) }; -} diff --git a/keyboard/hhkb/keymap_common.h b/keyboard/hhkb/keymap_common.h index 741ab21e..97e2e098 100644 --- a/keyboard/hhkb/keymap_common.h +++ b/keyboard/hhkb/keymap_common.h @@ -32,10 +32,6 @@ along with this program. If not, see . #include "keymap.h" -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const action_t fn_actions[]; - - #define KEYMAP( \ K31, K30, K00, K10, K11, K20, K21, K40, K41, K60, K61, K70, K71, K50, K51, \ K32, K01, K02, K13, K12, K23, K22, K42, K43, K62, K63, K73, K72, K52, \ diff --git a/keyboard/infinity/Makefile b/keyboard/infinity/Makefile index 052134c3..5b3c1fe6 100644 --- a/keyboard/infinity/Makefile +++ b/keyboard/infinity/Makefile @@ -9,7 +9,6 @@ OBJDIR = ./build OBJECTS = \ $(OBJDIR)/matrix.o \ - $(OBJDIR)/keymap_common.o \ $(OBJDIR)/led.o \ $(OBJDIR)/main.o diff --git a/keyboard/infinity/keymap_common.c b/keyboard/infinity/keymap_common.c deleted file mode 100644 index fdb1769e..00000000 --- a/keyboard/infinity/keymap_common.c +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -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 "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* 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)]) }; -} diff --git a/keyboard/infinity/keymap_common.h b/keyboard/infinity/keymap_common.h index 77f4fed2..412417a2 100644 --- a/keyboard/infinity/keymap_common.h +++ b/keyboard/infinity/keymap_common.h @@ -29,10 +29,6 @@ along with this program. If not, see . #include "keymap.h" -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const action_t fn_actions[]; - - #ifdef INFINITY_PROTOTYPE /* Infinity prototype */ diff --git a/keyboard/infinity_chibios/Makefile b/keyboard/infinity_chibios/Makefile index 9999451c..3873239a 100644 --- a/keyboard/infinity_chibios/Makefile +++ b/keyboard/infinity_chibios/Makefile @@ -9,7 +9,6 @@ TARGET_DIR = . # project specific files SRC = matrix.c \ - keymap_common.c \ led.c ifdef KEYMAP diff --git a/keyboard/infinity_chibios/keymap_common.c b/keyboard/infinity_chibios/keymap_common.c deleted file mode 100644 index 69b170ce..00000000 --- a/keyboard/infinity_chibios/keymap_common.c +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -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 "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return keymaps[(layer)][(key.row)][(key.col)]; -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t){ .code = fn_actions[FN_INDEX(keycode)] }; -} diff --git a/keyboard/infinity_chibios/keymap_common.h b/keyboard/infinity_chibios/keymap_common.h index 7d053277..d958f30f 100644 --- a/keyboard/infinity_chibios/keymap_common.h +++ b/keyboard/infinity_chibios/keymap_common.h @@ -30,10 +30,6 @@ along with this program. If not, see . #include "keymap.h" -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const action_t fn_actions[]; - - #ifdef INFINITY_PROTOTYPE /* Infinity prototype */ diff --git a/keyboard/onekey/keymap.c b/keyboard/onekey/keymap.c index 11804bf3..2a435634 100644 --- a/keyboard/onekey/keymap.c +++ b/keyboard/onekey/keymap.c @@ -16,7 +16,6 @@ along with this program. If not, see . */ #include #include -#include #include "keycode.h" #include "action.h" #include "action_macro.h" @@ -36,31 +35,3 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ static const action_t PROGMEM fn_actions[] = { }; - - - -#define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0])) -#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0])) - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - if (layer < KEYMAPS_SIZE) { - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); - } else { - // fall back to layer 0 - return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]); - } -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - action_t action; - if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) { - action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]); - } else { - action = (action_t)ACTION_NO; - } - return action; -} diff --git a/keyboard/stm32_f103_onekey/keymap_plain.c b/keyboard/stm32_f103_onekey/keymap_plain.c index 04011a29..5aee2b7f 100644 --- a/keyboard/stm32_f103_onekey/keymap_plain.c +++ b/keyboard/stm32_f103_onekey/keymap_plain.c @@ -40,5 +40,5 @@ uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) /* translates Fn keycode to action */ action_t keymap_fn_to_action(uint8_t keycode) { - return (action_t){ .code = fn_actions[FN_INDEX(keycode)] }; + return fn_actions[FN_INDEX(keycode)]; } diff --git a/keyboard/teensy_lc_onekey/keymap_plain.c b/keyboard/teensy_lc_onekey/keymap_plain.c index 250c6632..16b05a75 100644 --- a/keyboard/teensy_lc_onekey/keymap_plain.c +++ b/keyboard/teensy_lc_onekey/keymap_plain.c @@ -40,5 +40,5 @@ uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) /* translates Fn keycode to action */ action_t keymap_fn_to_action(uint8_t keycode) { - return (action_t){ .code = fn_actions[FN_INDEX(keycode)] }; + return fn_actions[FN_INDEX(keycode)]; }