summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredric Silberberg <fred@silberberg.xyz>2017-08-07 22:05:59 -0700
committerJack Humbert <jack.humb@gmail.com>2017-08-08 10:02:53 -0400
commit114565fe811f0264acfa52c38f993b37b0add43d (patch)
tree50e078f3604063a10eea56ee9c61163ed3f3fa2f
parente9d755b6f46d76f2697d59f1a56fd3536729a7e7 (diff)
downloadqmk_firmware-114565fe811f0264acfa52c38f993b37b0add43d.tar.gz
qmk_firmware-114565fe811f0264acfa52c38f993b37b0add43d.zip
Rename SHIFT macro to BV_64
-rw-r--r--quantum/process_keycode/process_key_lock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/quantum/process_keycode/process_key_lock.c b/quantum/process_keycode/process_key_lock.c
index b1ba397a02..d7978f91c7 100644
--- a/quantum/process_keycode/process_key_lock.c
+++ b/quantum/process_keycode/process_key_lock.c
@@ -18,14 +18,14 @@
#include "stdint.h"
#include "process_key_lock.h"
-#define SHIFT(shift) (((uint64_t)1) << (shift))
+#define BV_64(shift) (((uint64_t)1) << (shift))
#define GET_KEY_ARRAY(code) (((code) < 0x40) ? key_state[0] : \
((code) < 0x80) ? key_state[1] : \
((code) < 0xC0) ? key_state[2] : key_state[3])
#define GET_CODE_INDEX(code) (((code) < 0x40) ? (code) : \
((code) < 0x80) ? (code) - 0x40 : \
((code) < 0xC0) ? (code) - 0x80 : (code) - 0xC0)
-#define KEY_STATE(code) (GET_KEY_ARRAY(code) & SHIFT(GET_CODE_INDEX(code))) == SHIFT(GET_CODE_INDEX(code))
+#define KEY_STATE(code) (GET_KEY_ARRAY(code) & BV_64(GET_CODE_INDEX(code))) == BV_64(GET_CODE_INDEX(code))
#define SET_KEY_ARRAY_STATE(code, val) do { \
switch (code) { \
case 0x00 ... 0x3F: \
@@ -42,8 +42,8 @@
break; \
} \
} while(0)
-#define SET_KEY_STATE(code) SET_KEY_ARRAY_STATE(code, (GET_KEY_ARRAY(code) | SHIFT(GET_CODE_INDEX(code))))
-#define UNSET_KEY_STATE(code) SET_KEY_ARRAY_STATE(code, (GET_KEY_ARRAY(code)) & ~(SHIFT(GET_CODE_INDEX(code))))
+#define SET_KEY_STATE(code) SET_KEY_ARRAY_STATE(code, (GET_KEY_ARRAY(code) | BV_64(GET_CODE_INDEX(code))))
+#define UNSET_KEY_STATE(code) SET_KEY_ARRAY_STATE(code, (GET_KEY_ARRAY(code)) & ~(BV_64(GET_CODE_INDEX(code))))
#define IS_STANDARD_KEYCODE(code) ((code) <= 0xFF)
// Locked key state. This is an array of 256 bits, one for each of the standard keys supported qmk.