diff options
author | Konstantin Đorđević <vomindoraan@gmail.com> | 2020-07-16 14:27:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-16 22:27:55 +1000 |
commit | 61b64bb82a93c6d1441f07655a5e20b59a15fd29 (patch) | |
tree | 6821f6754bdcafd91fb16556f08e2e7ebf361bdf /users/konstantin/konstantin.h | |
parent | f11437aef392dc44573bf45a738ae758784d2f1b (diff) | |
download | qmk_firmware-61b64bb82a93c6d1441f07655a5e20b59a15fd29.tar.gz qmk_firmware-61b64bb82a93c6d1441f07655a5e20b59a15fd29.zip |
Redefine IS_LAYER_ON/OFF() as aliases for existing layer functions (#6352)
* Add IS_LAYER_ON_STATE()/IS_LAYER_OFF_STATE() macros
* Add docs for IS_LAYER_ON/OFF(_STATE) macros
* Remove IS_LAYER_ON/OFF_STATE redefinition in userspace
* Run clang-format on quantum/quantum.h
* Redefine IS_LAYER_ON/OFF(_STATE) as aliases of existing layer functions
Also update relevant doc entries.
Needs testing to check if this breaks existing IS_LAYER_ON/OFF usage in certain
edge cases (namely calling the macros with 0).
* Reformat layer check function docs
Diffstat (limited to 'users/konstantin/konstantin.h')
-rw-r--r-- | users/konstantin/konstantin.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/users/konstantin/konstantin.h b/users/konstantin/konstantin.h index 72a161623..249b3fe15 100644 --- a/users/konstantin/konstantin.h +++ b/users/konstantin/konstantin.h | |||
@@ -48,9 +48,6 @@ | |||
48 | #define LCT_CPS LCTL_T(KC_CAPS) | 48 | #define LCT_CPS LCTL_T(KC_CAPS) |
49 | #define RSF_SLS RSFT_T(KC_SLSH) | 49 | #define RSF_SLS RSFT_T(KC_SLSH) |
50 | 50 | ||
51 | #define IS_LAYER_ON_STATE(state, layer) ( (state) & (1UL << (layer))) | ||
52 | #define IS_LAYER_OFF_STATE(state, layer) (~(state) & (1UL << (layer))) | ||
53 | |||
54 | // Clear mods, perform action, restore mods | 51 | // Clear mods, perform action, restore mods |
55 | #define CLEAN_MODS(action) { \ | 52 | #define CLEAN_MODS(action) { \ |
56 | uint8_t mods = get_mods(); \ | 53 | uint8_t mods = get_mods(); \ |