X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Faction_util.c;h=77848c0923848ffa69896221c62c461d79b858f6;hb=4a8da0cb45abc9fd490944682acc71ccb0d5ee72;hp=61ff202befa510b9d08f3604f7fad50c607c11b7;hpb=48871b9b6b99201abc381ee27cfd94e211ca131a;p=qmk_firmware.git diff --git a/tmk_core/common/action_util.c b/tmk_core/common/action_util.c index 61ff202be..77848c092 100644 --- a/tmk_core/common/action_util.c +++ b/tmk_core/common/action_util.c @@ -20,6 +20,10 @@ along with this program. If not, see . #include "action_util.h" #include "action_layer.h" #include "timer.h" +#include "keycode_config.h" + +extern keymap_config_t keymap_config; + static inline void add_key_byte(uint8_t code); static inline void del_key_byte(uint8_t code); @@ -54,9 +58,13 @@ void set_oneshot_locked_mods(int8_t mods) { oneshot_locked_mods = mods; } void clear_oneshot_locked_mods(void) { oneshot_locked_mods = 0; } #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) static int16_t oneshot_time = 0; -inline bool has_oneshot_mods_timed_out() { +bool has_oneshot_mods_timed_out(void) { return TIMER_DIFF_16(timer_read(), oneshot_time) >= ONESHOT_TIMEOUT; } +#else +bool has_oneshot_mods_timed_out(void) { + return false; +} #endif #endif @@ -139,7 +147,7 @@ void send_keyboard_report(void) { void add_key(uint8_t key) { #ifdef NKRO_ENABLE - if (keyboard_protocol && keyboard_nkro) { + if (keyboard_protocol && keymap_config.nkro) { add_key_bit(key); return; } @@ -150,7 +158,7 @@ void add_key(uint8_t key) void del_key(uint8_t key) { #ifdef NKRO_ENABLE - if (keyboard_protocol && keyboard_nkro) { + if (keyboard_protocol && keymap_config.nkro) { del_key_bit(key); return; } @@ -231,7 +239,7 @@ uint8_t has_anymod(void) uint8_t get_first_key(void) { #ifdef NKRO_ENABLE - if (keyboard_protocol && keyboard_nkro) { + if (keyboard_protocol && keymap_config.nkro) { uint8_t i = 0; for (; i < KEYBOARD_REPORT_BITS && !keyboard_report->nkro.bits[i]; i++) ;