Changes in uspace/drv/bus/usb/usbhid/mouse/mousedev.c [b803845:f2964e45] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhid/mouse/mousedev.c
rb803845 rf2964e45 59 59 /*----------------------------------------------------------------------------*/ 60 60 61 constusb_endpoint_description_t usb_hid_mouse_poll_endpoint_description = {61 usb_endpoint_description_t usb_hid_mouse_poll_endpoint_description = { 62 62 .transfer_type = USB_TRANSFER_INTERRUPT, 63 63 .direction = USB_DIRECTION_IN, … … 268 268 269 269 int shift_x = get_mouse_axis_move_value(hid_dev->report_id, 270 &hid_dev->report, USB_HIDUT_USAGE_GENERIC_DESKTOP_X);270 hid_dev->report, USB_HIDUT_USAGE_GENERIC_DESKTOP_X); 271 271 int shift_y = get_mouse_axis_move_value(hid_dev->report_id, 272 &hid_dev->report, USB_HIDUT_USAGE_GENERIC_DESKTOP_Y);272 hid_dev->report, USB_HIDUT_USAGE_GENERIC_DESKTOP_Y); 273 273 int wheel = get_mouse_axis_move_value(hid_dev->report_id, 274 &hid_dev->report, USB_HIDUT_USAGE_GENERIC_DESKTOP_WHEEL);274 hid_dev->report, USB_HIDUT_USAGE_GENERIC_DESKTOP_WHEEL); 275 275 276 276 if ((shift_x != 0) || (shift_y != 0)) { 277 async_exch_t *exch = 278 async_exchange_begin(mouse_dev->mouse_sess); 277 async_exch_t *exch = async_exchange_begin(mouse_dev->mouse_sess); 279 278 async_req_2_0(exch, MOUSEEV_MOVE_EVENT, shift_x, shift_y); 280 279 async_exchange_end(exch); … … 292 291 293 292 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 294 &hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END 295 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, USB_HID_REPORT_TYPE_INPUT); 293 hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END 294 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 295 USB_HID_REPORT_TYPE_INPUT); 296 296 297 297 while (field != NULL) { … … 314 314 async_req_2_0(exch, MOUSEEV_BUTTON_EVENT, field->usage, 0); 315 315 async_exchange_end(exch); 316 316 317 317 mouse_dev->buttons[field->usage - field->usage_minimum] = 318 318 field->value; 319 319 } 320 320 321 321 field = usb_hid_report_get_sibling( 322 &hid_dev->report, field, path, USB_HID_PATH_COMPARE_END323 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 322 hid_dev->report, field, path, USB_HID_PATH_COMPARE_END 323 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 324 324 USB_HID_REPORT_TYPE_INPUT); 325 325 } … … 474 474 // that the current solution is good enough. 475 475 /* Adding 1 because we will be accessing buttons[highest]. */ 476 mouse_dev->buttons_count = 1 + usb_mouse_get_highest_button(477 &hid_dev->report, hid_dev->report_id);476 mouse_dev->buttons_count = usb_mouse_get_highest_button(hid_dev->report, 477 hid_dev->report_id) + 1; 478 478 mouse_dev->buttons = calloc(mouse_dev->buttons_count, sizeof(int32_t)); 479 479 … … 532 532 int usb_mouse_set_boot_protocol(usb_hid_dev_t *hid_dev) 533 533 { 534 int rc = usb_hid_parse_report_descriptor( 535 &hid_dev->report, USB_MOUSE_BOOT_REPORT_DESCRIPTOR,534 int rc = usb_hid_parse_report_descriptor(hid_dev->report, 535 USB_MOUSE_BOOT_REPORT_DESCRIPTOR, 536 536 USB_MOUSE_BOOT_REPORT_DESCRIPTOR_SIZE); 537 537 … … 542 542 } 543 543 544 rc = usbhid_req_set_protocol(&hid_dev->usb_dev->ctrl_pipe, 544 rc = usbhid_req_set_protocol(&hid_dev->usb_dev->ctrl_pipe, 545 545 hid_dev->usb_dev->interface_no, USB_HID_PROTOCOL_BOOT); 546 546
Note:
See TracChangeset
for help on using the changeset viewer.