aboutsummaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-11-15 10:21:22 +1100
committerGitHub <noreply@github.com>2019-11-15 10:21:22 +1100
commit30473357290747be06e9200a7d9c751738a3b0a1 (patch)
tree7d200332f182da03d8c6a493b1378265d473e74d /tmk_core
parenta2eb962704f1e87ed862a18650520df7a0fc5da8 (diff)
downloadqmk_firmware-30473357290747be06e9200a7d9c751738a3b0a1.tar.gz
qmk_firmware-30473357290747be06e9200a7d9c751738a3b0a1.zip
Add support for configurable polling interval and power usage o… (#7336)
* Add support for custom polling interval and power usage on V-USB boards * Use 1ms as default for now
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/protocol/vusb/vusb.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c
index 3719b7aa0..72445e00b 100644
--- a/tmk_core/protocol/vusb/vusb.c
+++ b/tmk_core/protocol/vusb/vusb.c
@@ -345,6 +345,15 @@ const PROGMEM uchar mouse_hid_report[] = {
345 0xc0, // END_COLLECTION 345 0xc0, // END_COLLECTION
346}; 346};
347 347
348#ifndef USB_MAX_POWER_CONSUMPTION
349# define USB_MAX_POWER_CONSUMPTION 500
350#endif
351
352// TODO: change this to 10ms to match LUFA
353#ifndef USB_POLLING_INTERVAL_MS
354# define USB_POLLING_INTERVAL_MS 1
355#endif
356
348/* 357/*
349 * Descriptor for compite device: Keyboard + Mouse 358 * Descriptor for compite device: Keyboard + Mouse
350 * 359 *
@@ -366,7 +375,7 @@ const PROGMEM char usbDescriptorConfiguration[] = {
366# else 375# else
367 (1 << 7), /* attributes */ 376 (1 << 7), /* attributes */
368# endif 377# endif
369 USB_CFG_MAX_BUS_POWER / 2, /* max USB current in 2mA units */ 378 USB_MAX_POWER_CONSUMPTION / 2, /* max USB current in 2mA units */
370 379
371 /* 380 /*
372 * Keyboard interface 381 * Keyboard interface
@@ -393,7 +402,7 @@ const PROGMEM char usbDescriptorConfiguration[] = {
393 (char)0x81, /* IN endpoint number 1 */ 402 (char)0x81, /* IN endpoint number 1 */
394 0x03, /* attrib: Interrupt endpoint */ 403 0x03, /* attrib: Interrupt endpoint */
395 8, 0, /* maximum packet size */ 404 8, 0, /* maximum packet size */
396 USB_CFG_INTR_POLL_INTERVAL, /* in ms */ 405 USB_POLLING_INTERVAL_MS, /* in ms */
397# endif 406# endif
398 407
399 /* 408 /*
@@ -424,7 +433,7 @@ const PROGMEM char usbDescriptorConfiguration[] = {
424 (char)(0x80 | USB_CFG_EP3_NUMBER), /* IN endpoint number 3 */ 433 (char)(0x80 | USB_CFG_EP3_NUMBER), /* IN endpoint number 3 */
425 0x03, /* attrib: Interrupt endpoint */ 434 0x03, /* attrib: Interrupt endpoint */
426 8, 0, /* maximum packet size */ 435 8, 0, /* maximum packet size */
427 USB_CFG_INTR_POLL_INTERVAL, /* in ms */ 436 USB_POLLING_INTERVAL_MS, /* in ms */
428# endif 437# endif
429}; 438};
430#endif 439#endif