Skip to content
Permalink
Browse files

subsys: usb: Make HID payload size configurable

The payload size was hardcoded to 64.
This commit adds a configuration option to choose > 64 bytes
when the device allows larger packets.
A configuration option USB_HID_MAX_PAYLOAD_SIZE is added in
subsys/usb/class/hid/Kconfig
The default value is set to 64

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
  • Loading branch information...
sathishkuttan authored and nashif committed May 7, 2018
1 parent 1b0641e commit a3095087aac219cecbfd7301642769b3f48d0429
Showing with 7 additions and 1 deletion.
  1. +6 −0 subsys/usb/class/hid/Kconfig
  2. +1 −1 subsys/usb/class/hid/core.c
@@ -30,4 +30,10 @@ config HID_INTERRUPT_EP_MPS
help
USB HID Device interrupt endpoint size

config USB_HID_MAX_PAYLOAD_SIZE
int
default 64
help
Max allowed payload size over USB HID Class

endif # USB_DEVICE_HID
@@ -229,7 +229,7 @@ USBD_CFG_DATA_DEFINE(hid) struct usb_cfg_data hid_config = {
};

#if !defined(CONFIG_USB_COMPOSITE_DEVICE)
static u8_t interface_data[64];
static u8_t interface_data[CONFIG_USB_HID_MAX_PAYLOAD_SIZE];
#endif

int usb_hid_init(void)

0 comments on commit a309508

Please sign in to comment.
You can’t perform that action at this time.