From c3200aa8fcf86122736846017ca7b125ac225842 Mon Sep 17 00:00:00 2001 From: Ted Lin <49993528+tedlinsonos@users.noreply.github.com> Date: Sun, 9 Feb 2020 23:50:45 -0500 Subject: [PATCH] Compile error if ONESHOT_TIMEOUT defined but oneshot disabled (#8100) * Compile error if ONESHOT_TIMEOUT defined but oneshot disabled When ONESHOT_TIMEOUT and NO_ACTION_ONESHOT are both defined, this code fails to compile. Wrap the one usage of ONESHOT_TIMEOUT that is inconsistent with the rest so all usages are properly wrapped by a check of NO_ACTION_ONESHOT. * Run file through clang-format Co-authored-by: Ted M Lin --- tmk_core/common/action.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 5dadba4fb..d572b7056 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -90,13 +90,15 @@ void action_exec(keyevent_t event) { keyrecord_t record = {.event = event}; -#if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) +#ifndef NO_ACTION_ONESHOT +# if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) if (has_oneshot_layer_timed_out()) { clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); } if (has_oneshot_mods_timed_out()) { clear_oneshot_mods(); } +# endif #endif #ifndef NO_ACTION_TAPPING