X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Fkeymap_common.c;h=b1460c53ccebe460b5ac2b62bfe426f7c312c10d;hb=137456e5b1fa5d8bc88e6775a496013dec530037;hp=6cf4f031fffd450eb0e9e73aee7e18fbe95e50ef;hpb=23839b8c6d2f955e4da89b0981948c721346c528;p=qmk_firmware.git diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 6cf4f031f..b1460c53c 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -123,7 +123,8 @@ action_t action_for_key(uint8_t layer, keypos_t key) action.code = ACTION_LAYER_TAP_TOGGLE(keycode & 0xFF); break; case QK_MOD_TAP ... QK_MOD_TAP_MAX: - action.code = ACTION_MODS_TAP_KEY((keycode >> 0x8) & 0x1F, keycode & 0xFF); + mod = mod_config((keycode >> 0x8) & 0x1F); + action.code = ACTION_MODS_TAP_KEY(mod, keycode & 0xFF); break; #ifdef BACKLIGHT_ENABLE case BL_0 ... BL_15: @@ -179,5 +180,12 @@ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) __attribute__ ((weak)) uint16_t keymap_function_id_to_action( uint16_t function_id ) { + // The compiler sees the empty (weak) fn_actions and generates a warning + // This function should not be called in that case, so the warning is too strict + // If this function is called however, the keymap should have overridden fn_actions, and then the compile + // is comparing against the wrong array + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Warray-bounds" return pgm_read_word(&fn_actions[function_id]); + #pragma GCC diagnostic pop }