forked from kofal.net/zmk
refactor(hid): Use proper defines for HID values.
* Add report ID defines and use them consistently. * Add defines for main item value flags to avoid magic constants.
This commit is contained in:
committed by
Pete Johanson
parent
34c8b3f1e3
commit
c2d220fbdf
@@ -12,9 +12,10 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||
#include <dt-bindings/zmk/modifiers.h>
|
||||
|
||||
static struct zmk_hid_keyboard_report keyboard_report = {
|
||||
.report_id = 1, .body = {.modifiers = 0, ._reserved = 0, .keys = {0}}};
|
||||
.report_id = ZMK_HID_REPORT_ID_KEYBOARD, .body = {.modifiers = 0, ._reserved = 0, .keys = {0}}};
|
||||
|
||||
static struct zmk_hid_consumer_report consumer_report = {.report_id = 2, .body = {.keys = {0}}};
|
||||
static struct zmk_hid_consumer_report consumer_report = {.report_id = ZMK_HID_REPORT_ID_CONSUMER,
|
||||
.body = {.keys = {0}}};
|
||||
|
||||
// Keep track of how often a modifier was pressed.
|
||||
// Only release the modifier if the count is 0.
|
||||
|
||||
@@ -47,12 +47,12 @@ enum {
|
||||
};
|
||||
|
||||
static struct hids_report input = {
|
||||
.id = 0x01,
|
||||
.id = ZMK_HID_REPORT_ID_KEYBOARD,
|
||||
.type = HIDS_INPUT,
|
||||
};
|
||||
|
||||
static struct hids_report consumer_input = {
|
||||
.id = 0x02,
|
||||
.id = ZMK_HID_REPORT_ID_CONSUMER,
|
||||
.type = HIDS_INPUT,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user