aboutsummaryrefslogtreecommitdiff
path: root/keyboard/hhkb/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboard/hhkb/keymap.c')
-rw-r--r--keyboard/hhkb/keymap.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/keyboard/hhkb/keymap.c b/keyboard/hhkb/keymap.c
index faa62dd7e..5c3bc9de6 100644
--- a/keyboard/hhkb/keymap.c
+++ b/keyboard/hhkb/keymap.c
@@ -48,8 +48,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
48 { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_NO } \ 48 { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_NO } \
49} 49}
50 50
51 51#ifdef KEYMAP_SECTION
52static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 52const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
53#else
54static const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
55#endif
53 /* Layer 0: Default Layer 56 /* Layer 0: Default Layer
54 * ,-----------------------------------------------------------. 57 * ,-----------------------------------------------------------.
55 * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| 58 * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|
@@ -186,7 +189,11 @@ enum macro_id {
186/* 189/*
187 * Fn action definition 190 * Fn action definition
188 */ 191 */
189static const uint16_t PROGMEM fn_actions[] = { 192#ifdef KEYMAP_SECTION
193const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
194#else
195static const uint16_t fn_actions[] PROGMEM = {
196#endif
190 [0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used) 197 [0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used)
191 [1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps) 198 [1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps)
192 [2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash* 199 [2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash*
@@ -310,10 +317,6 @@ uint8_t keymap_key_to_keycode(uint8_t layer, key_t key)
310action_t keymap_fn_to_action(uint8_t keycode) 317action_t keymap_fn_to_action(uint8_t keycode)
311{ 318{
312 action_t action; 319 action_t action;
313 if (FN_INDEX(keycode) < sizeof(fn_actions) / sizeof(fn_actions[0])) { 320 action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
314 action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
315 } else {
316 action.code = ACTION_NO;
317 }
318 return action; 321 return action;
319} 322}