Changeset 3bacee1 in mainline for uspace/drv/hid
- Timestamp:
- 2018-04-12T16:27:17Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3cf22f9
- Parents:
- 76d0981d
- git-author:
- Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
- Location:
- uspace/drv/hid
- Files:
-
- 2 edited
-
ps2mouse/ps2mouse.c (modified) (3 diffs)
-
usbhid/usbhid.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/hid/ps2mouse/ps2mouse.c
r76d0981d r3bacee1 165 165 166 166 /* Probe IntelliMouse extensions. */ 167 errno_t (*polling_f)(void *) = polling_ps2;167 errno_t (*polling_f)(void *) = polling_ps2; 168 168 if (probe_intellimouse(mouse, false) == EOK) { 169 169 ddf_msg(LVL_NOTE, "Enabled IntelliMouse extensions"); … … 253 253 errno_t rc; 254 254 255 bool buttons[PS2_BUTTON_COUNT] = { };255 bool buttons[PS2_BUTTON_COUNT] = { }; 256 256 while (true) { 257 uint8_t packet[PS2_BUFSIZE] = { };257 uint8_t packet[PS2_BUFSIZE] = { }; 258 258 rc = ps2_mouse_read_packet(mouse, packet, PS2_BUFSIZE); 259 259 if (rc != EOK) … … 305 305 errno_t rc; 306 306 307 bool buttons[INTELLIMOUSE_BUTTON_COUNT] = { };307 bool buttons[INTELLIMOUSE_BUTTON_COUNT] = { }; 308 308 while (true) { 309 uint8_t packet[INTELLIMOUSE_BUFSIZE] = { };309 uint8_t packet[INTELLIMOUSE_BUFSIZE] = { }; 310 310 rc = ps2_mouse_read_packet(mouse, packet, INTELLIMOUSE_BUFSIZE); 311 311 if (rc != EOK) -
uspace/drv/hid/usbhid/usbhid.c
r76d0981d r3bacee1 123 123 &usb_device_descriptors(hid_dev->usb_dev)->device; 124 124 125 return (d->vendor_id == mapping->vendor_id) 126 &&(d->product_id == mapping->product_id);125 return (d->vendor_id == mapping->vendor_id) && 126 (d->product_id == mapping->product_id); 127 127 } 128 128 … … 139 139 } 140 140 141 for (int i = 0; mapping->usage_path[i].usage != 0 142 ||mapping->usage_path[i].usage_page != 0; ++i) {141 for (int i = 0; mapping->usage_path[i].usage != 0 || 142 mapping->usage_path[i].usage_page != 0; ++i) { 143 143 if (usb_hid_report_path_append_item(usage_path, 144 144 mapping->usage_path[i].usage_page, … … 159 159 if (report_id != 0) { 160 160 usb_hid_report_path_set_report_id(usage_path, 161 report_id);161 report_id); 162 162 } 163 163 164 164 const usb_hid_report_field_t *field = 165 165 usb_hid_report_get_sibling( 166 &hid_dev->report, NULL, usage_path, mapping->compare,167 USB_HID_REPORT_TYPE_INPUT);166 &hid_dev->report, NULL, usage_path, mapping->compare, 167 USB_HID_REPORT_TYPE_INPUT); 168 168 169 169 usb_log_debug("Field: %p", field); … … 275 275 static const struct { 276 276 const usb_endpoint_description_t *desc; 277 const char *description;277 const char *description; 278 278 } endpoints[] = { 279 { &usb_hid_kbd_poll_endpoint_description, "Keyboard endpoint"},280 { &usb_hid_mouse_poll_endpoint_description, "Mouse endpoint"},281 { &usb_hid_generic_poll_endpoint_description, "Generic HID endpoint"},279 { &usb_hid_kbd_poll_endpoint_description, "Keyboard endpoint" }, 280 { &usb_hid_mouse_poll_endpoint_description, "Mouse endpoint" }, 281 { &usb_hid_generic_poll_endpoint_description, "Generic HID endpoint" }, 282 282 }; 283 283 … … 305 305 const size_t size = 306 306 usb_hid_report_byte_size(&hid_dev->report, report_id, 307 USB_HID_REPORT_TYPE_INPUT);307 USB_HID_REPORT_TYPE_INPUT); 308 308 usb_log_debug("Report ID: %u, size: %zu", report_id, size); 309 309 max_size = (size > max_size) ? size : max_size; … … 492 492 for (unsigned i = 0; i < hid_dev->subdriver_count; ++i) { 493 493 if (hid_dev->subdrivers[i].init != NULL) { 494 usb_log_debug("Initializing subdriver %d.", i);494 usb_log_debug("Initializing subdriver %d.", i); 495 495 const errno_t pret = hid_dev->subdrivers[i].init(hid_dev, 496 496 &hid_dev->subdrivers[i].data);
Note:
See TracChangeset
for help on using the changeset viewer.
