summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorinnovaker <66737976+innovaker@users.noreply.github.com>2020-10-27 18:42:41 +0000
committerinnovaker <66737976+innovaker@users.noreply.github.com>2020-10-27 22:36:26 +0000
commit8ce7d8de0133242d5896333add10be9ba2ae9363 (patch)
tree5c9ba776a8d46543b0b1be849fe905aea7b084af /app/src
parentf4596fc784d11aa2d03ff0b7fa0a921600fc2db2 (diff)
refactor(hid): Refactor consumer report to a configurable size
Diffstat (limited to 'app/src')
-rw-r--r--app/src/hid.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/app/src/hid.c b/app/src/hid.c
index 5e46832..28efee1 100644
--- a/app/src/hid.c
+++ b/app/src/hid.c
@@ -12,8 +12,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
static struct zmk_hid_keypad_report kp_report = {.report_id = 1,
.body = {.modifiers = 0, .keys = {0}}};
-static struct zmk_hid_consumer_report consumer_report = {.report_id = 2,
- .body = {.keys = {0, 0, 0, 0, 0, 0}}};
+static struct zmk_hid_consumer_report consumer_report = {.report_id = 2, .body = {.keys = {0}}};
#define _TOGGLE_MOD(mod, state) \
if (modifier > MOD_RGUI) { \
@@ -35,8 +34,6 @@ int zmk_hid_unregister_mods(zmk_mod_flags modifiers) {
return 0;
}
-#define MAX_KEYS 6
-
#define TOGGLE_KEYPAD(match, val) \
for (int idx = 0; idx < ZMK_HID_KEYPAD_NKRO_SIZE; idx++) { \
if (kp_report.body.keys[idx] != match) { \
@@ -47,7 +44,7 @@ int zmk_hid_unregister_mods(zmk_mod_flags modifiers) {
}
#define TOGGLE_CONSUMER(match, val) \
- for (int idx = 0; idx < MAX_KEYS; idx++) { \
+ for (int idx = 0; idx < ZMK_HID_CONSUMER_NKRO_SIZE; idx++) { \
if (consumer_report.body.keys[idx] != match) { \
continue; \
} \