diff --git a/Kconfig b/Kconfig index 778f5d9..b230263 100644 --- a/Kconfig +++ b/Kconfig @@ -1,7 +1,7 @@ config RAW_HID bool "Enable Raw HID" depends on !ZMK_SPLIT || ZMK_SPLIT_ROLE_CENTRAL - default n + imply USB_DEVICE_HID config RAW_HID_USAGE_PAGE hex "Raw HID Usage Page" @@ -11,6 +11,10 @@ config RAW_HID_USAGE hex "Raw HID Usage" default 0x61 +config RAW_HID_REPORT_SIZE + int "Raw HID Report Size" + default 32 + config RAW_HID_DEVICE string "Raw HID Device" - default HID_1 + default HID_1 \ No newline at end of file diff --git a/boards/shields/raw_hid_adapter/raw_hid_adapter.conf b/boards/shields/raw_hid_adapter/raw_hid_adapter.conf index 4925176..22f0427 100644 --- a/boards/shields/raw_hid_adapter/raw_hid_adapter.conf +++ b/boards/shields/raw_hid_adapter/raw_hid_adapter.conf @@ -1,8 +1,5 @@ # enable Raw HID module CONFIG_RAW_HID=y -# enable USB HID device -CONFIG_USB_DEVICE_HID=y - # add additional USB HID device CONFIG_USB_HID_DEVICE_COUNT=2 \ No newline at end of file diff --git a/include/raw_hid/raw_hid.h b/include/raw_hid/raw_hid.h index 4f4385a..1cc555c 100644 --- a/include/raw_hid/raw_hid.h +++ b/include/raw_hid/raw_hid.h @@ -18,7 +18,7 @@ static const uint8_t raw_hid_report_desc[] = { HID_LOGICAL_MIN8(0x00), HID_LOGICAL_MAX16(0xFF, 0x00), HID_REPORT_SIZE(0x08), - HID_REPORT_COUNT(32), + HID_REPORT_COUNT(CONFIG_RAW_HID_REPORT_SIZE), HID_USAGE(0x01), HID_INPUT(ZMK_HID_MAIN_VAL_DATA | ZMK_HID_MAIN_VAL_VAR | ZMK_HID_MAIN_VAL_ABS), @@ -30,4 +30,4 @@ static const uint8_t raw_hid_report_desc[] = { HID_END_COLLECTION, }; -void process_raw_hid_data(uint8_t *data, uint8_t length); \ No newline at end of file +void process_raw_hid_data(uint8_t *data); \ No newline at end of file diff --git a/src/hog.c b/src/hog.c index 1fdf58d..e7e47e6 100644 --- a/src/hog.c +++ b/src/hog.c @@ -66,7 +66,7 @@ static ssize_t write_hids_raw_hid_report(struct bt_conn *conn, const struct bt_g } uint8_t *data = (uint8_t *)buf; - process_raw_hid_data(data, len); + process_raw_hid_data(data); return len; } diff --git a/src/raw_hid.c b/src/raw_hid.c index ac5d4b0..12b0adc 100644 --- a/src/raw_hid.c +++ b/src/raw_hid.c @@ -3,8 +3,8 @@ #include LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); -__attribute__((weak)) void process_raw_hid_data(uint8_t *data, uint8_t length) { - LOG_WRN("display_process_raw_hid_data is not overriden"); +__attribute__((weak)) void process_raw_hid_data(uint8_t *data) { + LOG_WRN("process_raw_hid_data is not overriden"); return; } diff --git a/src/usb_hid.c b/src/usb_hid.c index 17850e7..182d1ad 100644 --- a/src/usb_hid.c +++ b/src/usb_hid.c @@ -30,7 +30,7 @@ static int set_report_cb(const struct device *dev, struct usb_setup_packet *setu return -ENOTSUP; } - process_raw_hid_data(*data, *len); + process_raw_hid_data(*data); return 0; }