diff options
author | Ryan <fauxpark@gmail.com> | 2022-01-25 08:22:20 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 21:22:20 +0000 |
commit | 1d11ae3087f583c4f4756169802b33adea71ed94 (patch) | |
tree | 6a9deedeecec0220c2dccd10e90941956c4d27b7 /quantum/keymap_common.c | |
parent | 3340ca46e82c8b348d9131de53b73e83d1f2c285 (diff) | |
download | qmk_firmware-1d11ae3087f583c4f4756169802b33adea71ed94.tar.gz qmk_firmware-1d11ae3087f583c4f4756169802b33adea71ed94.zip |
Rip out old macro and action_function system (#16025)
* Rip out old macro and action_function system
* Update quantum/action_util.c
Co-authored-by: Joel Challis <git@zvecr.com>
Diffstat (limited to 'quantum/keymap_common.c')
-rw-r--r-- | quantum/keymap_common.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 5007f15f11..cd67f71a8f 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "keycode.h" #include "action_layer.h" #include "action.h" -#include "action_macro.h" #include "debug.h" #include "quantum.h" @@ -80,24 +79,6 @@ action_t action_for_keycode(uint16_t keycode) { // Split it up action.code = ACTION_MODS_KEY(keycode >> 8, keycode & 0xFF); // adds modifier to key break; -#ifndef NO_ACTION_FUNCTION - case KC_FN0 ... KC_FN31: - action.code = keymap_function_id_to_action(FN_INDEX(keycode)); - break; - case QK_FUNCTION ... QK_FUNCTION_MAX:; - // Is a shortcut for function action_layer, pull last 12bits - // This means we have 4,096 FN macros at our disposal - action.code = keymap_function_id_to_action((int)keycode & 0xFFF); - break; -#endif -#ifndef NO_ACTION_MACRO - case QK_MACRO ... QK_MACRO_MAX: - if (keycode & 0x800) // tap macros have upper bit set - action.code = ACTION_MACRO_TAP(keycode & 0xFF); - else - action.code = ACTION_MACRO(keycode & 0xFF); - break; -#endif #ifndef NO_ACTION_LAYER case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: action.code = ACTION_LAYER_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF); @@ -165,30 +146,8 @@ action_t action_for_keycode(uint16_t keycode) { return action; } -__attribute__((weak)) const uint16_t PROGMEM fn_actions[] = { - -}; - -/* Macro */ -__attribute__((weak)) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; } - -/* Function */ -__attribute__((weak)) void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {} - // translates key to keycode __attribute__((weak)) uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { // Read entire word (16bits) return pgm_read_word(&keymaps[(layer)][(key.row)][(key.col)]); } - -// translates function id to action -__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 -} |