]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/common/action_util.c
Modify pinout and layouts for Nyquist
[qmk_firmware.git] / tmk_core / common / action_util.c
index 61ff202befa510b9d08f3604f7fad50c607c11b7..77848c0923848ffa69896221c62c461d79b858f6 100644 (file)
@@ -20,6 +20,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #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++)
             ;