Changeset 2d1ba51 in mainline for uspace/drv/bus/usb/usbhid/kbd/kbddev.c
- Timestamp:
- 2011-11-09T14:55:04Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 747ef72
- Parents:
- f317490
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhid/kbd/kbddev.c
rf317490 r2d1ba51 103 103 /*----------------------------------------------------------------------------*/ 104 104 static const uint8_t USB_KBD_BOOT_REPORT_DESCRIPTOR[] = { 105 0x05, 0x01, // Usage Page (Generic Desktop), 106 0x09, 0x06, // Usage (Keyboard), 107 0xA1, 0x01, // Collection (Application), 108 0x75, 0x01, // Report Size (1), 109 0x95, 0x08, // Report Count (8), 110 0x05, 0x07, // Usage Page (Key Codes); 111 0x19, 0xE0, // Usage Minimum (224), 112 0x29, 0xE7, // Usage Maximum (231), 113 0x15, 0x00, // Logical Minimum (0), 114 0x25, 0x01, // Logical Maximum (1), 115 0x81, 0x02, // Input (Data, Variable, Absolute), ; Modifier byte 116 0x95, 0x01, // Report Count (1), 117 0x75, 0x08, // Report Size (8), 118 0x81, 0x01, // Input (Constant), ; Reserved byte 119 0x95, 0x05, // Report Count (5), 120 0x75, 0x01, // Report Size (1), 121 0x05, 0x08, // Usage Page (Page# for LEDs), 122 0x19, 0x01, // Usage Minimum (1), 123 0x29, 0x05, // Usage Maxmimum (5), 124 0x91, 0x02, // Output (Data, Variable, Absolute), ; LED report 125 0x95, 0x01, // Report Count (1), 126 0x75, 0x03, // Report Size (3), 127 0x91, 0x01, // Output (Constant), ; LED report padding 128 0x95, 0x06, // Report Count (6), 129 0x75, 0x08, // Report Size (8), 130 0x15, 0x00, // Logical Minimum (0), 131 0x25, 0xff, // Logical Maximum (255), 132 0x05, 0x07, // Usage Page (Key Codes), 133 0x19, 0x00, // Usage Minimum (0), 134 0x29, 0xff, // Usage Maximum (255), 135 0x81, 0x00, // Input (Data, Array), ; Key arrays (6 bytes) 136 0xC0 // End Collection 137 105 0x05, 0x01, /* Usage Page (Generic Desktop), */ 106 0x09, 0x06, /* Usage (Keyboard), */ 107 0xA1, 0x01, /* Collection (Application), */ 108 0x75, 0x01, /* Report Size (1), */ 109 0x95, 0x08, /* Report Count (8), */ 110 0x05, 0x07, /* Usage Page (Key Codes); */ 111 0x19, 0xE0, /* Usage Minimum (224), */ 112 0x29, 0xE7, /* Usage Maximum (231), */ 113 0x15, 0x00, /* Logical Minimum (0), */ 114 0x25, 0x01, /* Logical Maximum (1), */ 115 0x81, 0x02, /* Input (Data, Variable, Absolute), ; Modifier byte */ 116 0x95, 0x01, /* Report Count (1), */ 117 0x75, 0x08, /* Report Size (8), */ 118 0x81, 0x01, /* Input (Constant), ; Reserved byte */ 119 0x95, 0x05, /* Report Count (5), */ 120 0x75, 0x01, /* Report Size (1), */ 121 0x05, 0x08, /* Usage Page (Page# for LEDs), */ 122 0x19, 0x01, /* Usage Minimum (1), */ 123 0x29, 0x05, /* Usage Maxmimum (5), */ 124 0x91, 0x02, /* Output (Data, Variable, Absolute), ; LED report */ 125 0x95, 0x01, /* Report Count (1), */ 126 0x75, 0x03, /* Report Size (3), */ 127 0x91, 0x01, /* Output (Constant), ; LED report padding */ 128 0x95, 0x06, /* Report Count (6), */ 129 0x75, 0x08, /* Report Size (8), */ 130 0x15, 0x00, /* Logical Minimum (0), */ 131 0x25, 0xff, /* Logical Maximum (255), */ 132 0x05, 0x07, /* Usage Page (Key Codes), */ 133 0x19, 0x00, /* Usage Minimum (0), */ 134 0x29, 0xff, /* Usage Maximum (255), */ 135 0x81, 0x00, /* Input (Data, Array), ; Key arrays (6 bytes) */ 136 0xC0 /* End Collection */ 138 137 }; 139 138 /*----------------------------------------------------------------------------*/ … … 207 206 208 207 } 209 210 208 /*----------------------------------------------------------------------------*/ 211 209 /* Key processing functions */ … … 448 446 usb_hid_report_path_set_report_id(path, hid_dev->report_id); 449 447 450 // fill in the currently pressed keys 451 448 /* Fill in the currently pressed keys. */ 452 449 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 453 450 &hid_dev->report, NULL, path, … … 462 459 assert(i < kbd_dev->key_count); 463 460 464 / / save the key usage461 /* Save the key usage. */ 465 462 if (field->value != 0) { 466 463 kbd_dev->keys[i] = field->usage; … … 500 497 } 501 498 502 /* 503 * Store the initialized HID device and HID ops 504 * to the DDF function. 505 */ 499 /* Store the initialized HID device and HID ops 500 * to the DDF function. */ 506 501 fun->ops = &kbd_dev->ops; 507 502 fun->driver_data = kbd_dev; … … 511 506 usb_log_error("Could not bind DDF function: %s.\n", 512 507 str_error(rc)); 513 fun->driver_data = NULL; /* We need this later*/508 fun->driver_data = NULL; /* We did not allocate this. */ 514 509 ddf_fun_destroy(fun); 515 510 return rc; … … 527 522 HID_KBD_CLASS_NAME, str_error(rc)); 528 523 if (ddf_fun_unbind(fun) == EOK) { 529 fun->driver_data = NULL; /* We need this later*/524 fun->driver_data = NULL; /* We did not allocate this. */ 530 525 ddf_fun_destroy(fun); 531 526 } else { … … 674 669 } 675 670 676 /* 677 * Set LEDs according to initial setup. 678 * Set Idle rate 679 */ 671 /* Set LEDs according to initial setup. 672 * Set Idle rate */ 680 673 usb_kbd_set_led(hid_dev, kbd_dev); 681 674 … … 779 772 if (usb_kbd_is_initialized(kbd_dev)) { 780 773 kbd_dev->initialized = USB_KBD_STATUS_TO_DESTROY; 781 /* wait for autorepeat */774 /* Wait for autorepeat */ 782 775 async_usleep(CHECK_DELAY); 783 776 }
Note:
See TracChangeset
for help on using the changeset viewer.