diff options
author | Ted Lin <49993528+tedlinsonos@users.noreply.github.com> | 2020-02-09 23:50:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-10 04:50:45 +0000 |
commit | c3200aa8fcf86122736846017ca7b125ac225842 (patch) | |
tree | c0d40ba00f5ea9eb4126bcf9d188859ca914aced /tmk_core/common/action.c | |
parent | 6052aa499e6fa6f2601d71b18301a76218944463 (diff) | |
download | qmk_firmware-c3200aa8fcf86122736846017ca7b125ac225842.tar.gz qmk_firmware-c3200aa8fcf86122736846017ca7b125ac225842.zip |
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 <tedmlin@gmail.com>
Diffstat (limited to 'tmk_core/common/action.c')
-rw-r--r-- | tmk_core/common/action.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) { | |||
90 | 90 | ||
91 | keyrecord_t record = {.event = event}; | 91 | keyrecord_t record = {.event = event}; |
92 | 92 | ||
93 | #if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) | 93 | #ifndef NO_ACTION_ONESHOT |
94 | # if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) | ||
94 | if (has_oneshot_layer_timed_out()) { | 95 | if (has_oneshot_layer_timed_out()) { |
95 | clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); | 96 | clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); |
96 | } | 97 | } |
97 | if (has_oneshot_mods_timed_out()) { | 98 | if (has_oneshot_mods_timed_out()) { |
98 | clear_oneshot_mods(); | 99 | clear_oneshot_mods(); |
99 | } | 100 | } |
101 | # endif | ||
100 | #endif | 102 | #endif |
101 | 103 | ||
102 | #ifndef NO_ACTION_TAPPING | 104 | #ifndef NO_ACTION_TAPPING |