diff options
| -rw-r--r-- | common.mk | 2 | ||||
| -rw-r--r-- | common/action.c | 2 | ||||
| -rw-r--r-- | common/action_layer.c (renamed from common/layer_switch.c) | 2 | ||||
| -rw-r--r-- | common/action_layer.h (renamed from common/layer_switch.h) | 4 | ||||
| -rw-r--r-- | common/command.c | 2 | ||||
| -rw-r--r-- | common/keymap.c | 2 | ||||
| -rw-r--r-- | converter/pc98_usb/keymap.c | 32 | ||||
| -rw-r--r-- | converter/pc98_usb/matrix.c | 4 | ||||
| -rw-r--r-- | keyboard/gh60/keymap.c | 1 | ||||
| -rw-r--r-- | keyboard/hid_liber/keymap.c | 29 |
10 files changed, 20 insertions, 60 deletions
| @@ -5,7 +5,7 @@ SRC += $(COMMON_DIR)/host.c \ | |||
| 5 | $(COMMON_DIR)/action_tapping.c \ | 5 | $(COMMON_DIR)/action_tapping.c \ |
| 6 | $(COMMON_DIR)/action_oneshot.c \ | 6 | $(COMMON_DIR)/action_oneshot.c \ |
| 7 | $(COMMON_DIR)/action_macro.c \ | 7 | $(COMMON_DIR)/action_macro.c \ |
| 8 | $(COMMON_DIR)/layer_switch.c \ | 8 | $(COMMON_DIR)/action_layer.c \ |
| 9 | $(COMMON_DIR)/keymap.c \ | 9 | $(COMMON_DIR)/keymap.c \ |
| 10 | $(COMMON_DIR)/timer.c \ | 10 | $(COMMON_DIR)/timer.c \ |
| 11 | $(COMMON_DIR)/print.c \ | 11 | $(COMMON_DIR)/print.c \ |
diff --git a/common/action.c b/common/action.c index 596831d4d..158522dd0 100644 --- a/common/action.c +++ b/common/action.c | |||
| @@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 21 | #include "command.h" | 21 | #include "command.h" |
| 22 | #include "debug.h" | 22 | #include "debug.h" |
| 23 | #include "led.h" | 23 | #include "led.h" |
| 24 | #include "layer_switch.h" | 24 | #include "action_layer.h" |
| 25 | #include "action_tapping.h" | 25 | #include "action_tapping.h" |
| 26 | #include "action_oneshot.h" | 26 | #include "action_oneshot.h" |
| 27 | #include "action_macro.h" | 27 | #include "action_macro.h" |
diff --git a/common/layer_switch.c b/common/action_layer.c index 9905741f4..3413c53e6 100644 --- a/common/layer_switch.c +++ b/common/action_layer.c | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | #include "action.h" | 3 | #include "action.h" |
| 4 | #include "debug.h" | 4 | #include "debug.h" |
| 5 | #include "util.h" | 5 | #include "util.h" |
| 6 | #include "layer_switch.h" | 6 | #include "action_layer.h" |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | /* | 9 | /* |
diff --git a/common/layer_switch.h b/common/action_layer.h index ed8dfb502..23f8a00bb 100644 --- a/common/layer_switch.h +++ b/common/action_layer.h | |||
| @@ -14,8 +14,8 @@ GNU General Public License for more details. | |||
| 14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | #ifndef LAYER_SWITCH_H | 17 | #ifndef ACTION_LAYER_H |
| 18 | #define LAYER_SWITCH_H | 18 | #define ACTION_LAYER_H |
| 19 | 19 | ||
| 20 | #include <stdint.h> | 20 | #include <stdint.h> |
| 21 | #include "keyboard.h" | 21 | #include "keyboard.h" |
diff --git a/common/command.c b/common/command.c index c954ff02f..dc06c6da3 100644 --- a/common/command.c +++ b/common/command.c | |||
| @@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 26 | #include "timer.h" | 26 | #include "timer.h" |
| 27 | #include "keyboard.h" | 27 | #include "keyboard.h" |
| 28 | #include "bootloader.h" | 28 | #include "bootloader.h" |
| 29 | #include "layer_switch.h" | 29 | #include "action_layer.h" |
| 30 | #include "eeconfig.h" | 30 | #include "eeconfig.h" |
| 31 | #include "sleep_led.h" | 31 | #include "sleep_led.h" |
| 32 | #include "led.h" | 32 | #include "led.h" |
diff --git a/common/keymap.c b/common/keymap.c index ace3f49b6..c98ce09b6 100644 --- a/common/keymap.c +++ b/common/keymap.c | |||
| @@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 18 | #include "keymap.h" | 18 | #include "keymap.h" |
| 19 | #include "report.h" | 19 | #include "report.h" |
| 20 | #include "keycode.h" | 20 | #include "keycode.h" |
| 21 | #include "layer_switch.h" | 21 | #include "action_layer.h" |
| 22 | #include "action.h" | 22 | #include "action.h" |
| 23 | #include "action_macro.h" | 23 | #include "action_macro.h" |
| 24 | #include "debug.h" | 24 | #include "debug.h" |
diff --git a/converter/pc98_usb/keymap.c b/converter/pc98_usb/keymap.c index 279b2b60c..3ab0a4dbe 100644 --- a/converter/pc98_usb/keymap.c +++ b/converter/pc98_usb/keymap.c | |||
| @@ -21,7 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 21 | #include "keycode.h" | 21 | #include "keycode.h" |
| 22 | #include "action.h" | 22 | #include "action.h" |
| 23 | #include "action_macro.h" | 23 | #include "action_macro.h" |
| 24 | #include "layer_switch.h" | ||
| 25 | #include "util.h" | 24 | #include "util.h" |
| 26 | #include "keymap.h" | 25 | #include "keymap.h" |
| 27 | 26 | ||
| @@ -165,10 +164,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) | |||
| 165 | * Fn actions | 164 | * Fn actions |
| 166 | */ | 165 | */ |
| 167 | static const uint16_t PROGMEM fn_actions[] = { | 166 | static const uint16_t PROGMEM fn_actions[] = { |
| 168 | ACTION_KEYMAP_TAP_TOGGLE(0), // FN0 | 167 | ACTION_LAYER_TAP_TOGGLE(0), // FN0 |
| 169 | ACTION_KEYMAP_TAP_KEY(1, KC_SLASH), // FN1 | 168 | ACTION_LAYER_TAP_KEY(1, KC_SLASH), // FN1 |
| 170 | ACTION_KEYMAP_TAP_KEY(2, KC_SCLN), // FN2 | 169 | ACTION_LAYER_TAP_KEY(2, KC_SCLN), // FN2 |
| 171 | ACTION_KEYMAP_MOMENTARY(2), // FN3 | 170 | ACTION_LAYER_MOMENTARY(2), // FN3 |
| 172 | ACTION_MACRO(LBRACKET), // FN4 | 171 | ACTION_MACRO(LBRACKET), // FN4 |
| 173 | ACTION_MACRO(RBRACKET), // FN5 | 172 | ACTION_MACRO(RBRACKET), // FN5 |
| 174 | ACTION_MACRO(DUMMY), // FN6 | 173 | ACTION_MACRO(DUMMY), // FN6 |
| @@ -183,29 +182,16 @@ static const uint16_t PROGMEM fn_actions[] = { | |||
| 183 | * No need to edit. | 182 | * No need to edit. |
| 184 | */ | 183 | */ |
| 185 | #define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0])) | 184 | #define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0])) |
| 186 | #define OVERLAYS_SIZE (sizeof(overlays) / sizeof(overlays[0])) | ||
| 187 | #define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0])) | 185 | #define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0])) |
| 188 | 186 | ||
| 189 | /* translates key to keycode */ | 187 | /* translates key to keycode */ |
| 190 | uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) | 188 | uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) |
| 191 | { | 189 | { |
| 192 | /* Overlay: 16-31(OVERLAY_BIT(0x10) | overlay_layer) */ | 190 | if (layer < KEYMAPS_SIZE) { |
| 193 | if (layer & OVERLAY_BIT) { | 191 | return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); |
| 194 | layer &= OVERLAY_MASK; | 192 | } else { |
| 195 | if (layer < OVERLAYS_SIZE) { | 193 | // fall back to layer 0 |
| 196 | return pgm_read_byte(&overlays[(layer)][(key.row)][(key.col)]); | 194 | return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]); |
| 197 | } else { | ||
| 198 | return KC_TRANSPARENT; | ||
| 199 | } | ||
| 200 | } | ||
| 201 | /* Keymap: 0-15 */ | ||
| 202 | else { | ||
| 203 | if (layer < KEYMAPS_SIZE) { | ||
| 204 | return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); | ||
| 205 | } else { | ||
| 206 | // fall back to layer 0 | ||
| 207 | return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]); | ||
| 208 | } | ||
| 209 | } | 195 | } |
| 210 | } | 196 | } |
| 211 | 197 | ||
diff --git a/converter/pc98_usb/matrix.c b/converter/pc98_usb/matrix.c index d03aaf10d..8833e0a85 100644 --- a/converter/pc98_usb/matrix.c +++ b/converter/pc98_usb/matrix.c | |||
| @@ -93,10 +93,6 @@ RETRY: | |||
| 93 | 93 | ||
| 94 | void matrix_init(void) | 94 | void matrix_init(void) |
| 95 | { | 95 | { |
| 96 | print_enable = true; | ||
| 97 | // debug_enable = true; | ||
| 98 | // debug_matrix = true; | ||
| 99 | |||
| 100 | PC98_RST_DDR |= (1<<PC98_RST_BIT); | 96 | PC98_RST_DDR |= (1<<PC98_RST_BIT); |
| 101 | PC98_RDY_DDR |= (1<<PC98_RDY_BIT); | 97 | PC98_RDY_DDR |= (1<<PC98_RDY_BIT); |
| 102 | PC98_RTY_DDR |= (1<<PC98_RTY_BIT); | 98 | PC98_RTY_DDR |= (1<<PC98_RTY_BIT); |
diff --git a/keyboard/gh60/keymap.c b/keyboard/gh60/keymap.c index 2f41ad4fd..6db4d3db0 100644 --- a/keyboard/gh60/keymap.c +++ b/keyboard/gh60/keymap.c | |||
| @@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 20 | #include "keycode.h" | 20 | #include "keycode.h" |
| 21 | #include "action.h" | 21 | #include "action.h" |
| 22 | #include "action_macro.h" | 22 | #include "action_macro.h" |
| 23 | #include "layer_switch.h" | ||
| 24 | #include "report.h" | 23 | #include "report.h" |
| 25 | #include "host.h" | 24 | #include "host.h" |
| 26 | #include "print.h" | 25 | #include "print.h" |
diff --git a/keyboard/hid_liber/keymap.c b/keyboard/hid_liber/keymap.c index f3d6bfa2e..609edb5e1 100644 --- a/keyboard/hid_liber/keymap.c +++ b/keyboard/hid_liber/keymap.c | |||
| @@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 24 | #include "keycode.h" | 24 | #include "keycode.h" |
| 25 | #include "action.h" | 25 | #include "action.h" |
| 26 | #include "action_macro.h" | 26 | #include "action_macro.h" |
| 27 | #include "layer_switch.h" | ||
| 28 | #include "report.h" | 27 | #include "report.h" |
| 29 | #include "host.h" | 28 | #include "host.h" |
| 30 | #include "print.h" | 29 | #include "print.h" |
| @@ -160,8 +159,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 160 | 159 | ||
| 161 | }; | 160 | }; |
| 162 | 161 | ||
| 163 | static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {}; | ||
| 164 | |||
| 165 | /* | 162 | /* |
| 166 | * Fn action definition | 163 | * Fn action definition |
| 167 | */ | 164 | */ |
| @@ -179,33 +176,15 @@ static const uint16_t PROGMEM fn_actions[] = { | |||
| 179 | #endif | 176 | #endif |
| 180 | 177 | ||
| 181 | #define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0])) | 178 | #define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0])) |
| 182 | #define OVERLAYS_SIZE (sizeof(overlays) / sizeof(overlays[0])) | ||
| 183 | #define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0])) | 179 | #define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0])) |
| 184 | 180 | ||
| 185 | /* translates key to keycode */ | 181 | /* translates key to keycode */ |
| 186 | uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) | 182 | uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) |
| 187 | { | 183 | { |
| 188 | /* Overlay: 16-31(OVERLAY_BIT(0x10) | overlay_layer) */ | 184 | if (layer < KEYMAPS_SIZE) { |
| 189 | if (layer & OVERLAY_BIT) { | 185 | return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); |
| 190 | layer &= OVERLAY_MASK; | 186 | } else { |
| 191 | if (layer < OVERLAYS_SIZE) { | 187 | return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]); |
| 192 | return pgm_read_byte(&overlays[(layer)][(key.row)][(key.col)]); | ||
| 193 | } else { | ||
| 194 | // XXX: this may cuaes bootlaoder_jump incositent fail. | ||
| 195 | //debug("key_to_keycode: overlay "); debug_dec(layer); debug(" is invalid.\n"); | ||
| 196 | return KC_TRANSPARENT; | ||
| 197 | } | ||
| 198 | } | ||
| 199 | /* Keymap: 0-15 */ | ||
| 200 | else { | ||
| 201 | if (layer < KEYMAPS_SIZE) { | ||
| 202 | return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); | ||
| 203 | } else { | ||
| 204 | // XXX: this may cuaes bootlaoder_jump incositent fail. | ||
| 205 | //debug("key_to_keycode: base "); debug_dec(layer); debug(" is invalid.\n"); | ||
| 206 | // fall back to layer 0 | ||
| 207 | return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]); | ||
| 208 | } | ||
| 209 | } | 188 | } |
| 210 | } | 189 | } |
| 211 | 190 | ||
