refactor(app): Replace `HID_EXT_USAGE` with `HID_USAGE`

Simplifies terminology and improves readability.
This commit is contained in:
innovaker 2020-11-06 20:28:44 +00:00
parent 0031f9bd4d
commit c21897856b
3 changed files with 376 additions and 389 deletions

View File

@ -10,9 +10,9 @@
#pragma once
#define HID_EXT_USAGE(page, id) ((page << 16) | id)
#define HID_EXT_USAGE_ID(ext) (ext & 0xFFFF)
#define HID_EXT_USAGE_PAGE(ext) (ext >> 16)
#define HID_USAGE(page, id) ((page << 16) | id)
#define HID_USAGE_ID(usage) (usage & 0xFFFF)
#define HID_USAGE_PAGE(usage) (usage >> 16)
/* WARNING: DEPRECATED from dt-bindings/zmk/keys.h */
#define USAGE_KEYPAD (0x07) // WARNING: DEPRECATED (DO NOT USE)

File diff suppressed because it is too large Load Diff

View File

@ -24,8 +24,8 @@ ZMK_EVENT_DECLARE(keycode_state_changed);
static inline struct keycode_state_changed *keycode_state_changed_from_encoded(u32_t encoded,
bool pressed) {
u16_t page = HID_EXT_USAGE_PAGE(encoded) & 0xFF;
u16_t id = HID_EXT_USAGE_ID(encoded);
u16_t page = HID_USAGE_PAGE(encoded) & 0xFF;
u16_t id = HID_USAGE_ID(encoded);
zmk_mod_flags implicit_mods = SELECT_MODS(encoded);
if (!page) {