Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhid/mouse/mousedev.c

    rf2964e45 rb803845  
    5959/*----------------------------------------------------------------------------*/
    6060
    61 usb_endpoint_description_t usb_hid_mouse_poll_endpoint_description = {
     61const usb_endpoint_description_t usb_hid_mouse_poll_endpoint_description = {
    6262        .transfer_type = USB_TRANSFER_INTERRUPT,
    6363        .direction = USB_DIRECTION_IN,
     
    268268
    269269        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);
    271271        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);
    273273        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);
    275275
    276276        if ((shift_x != 0) || (shift_y != 0)) {
    277                 async_exch_t *exch = async_exchange_begin(mouse_dev->mouse_sess);
     277                async_exch_t *exch =
     278                    async_exchange_begin(mouse_dev->mouse_sess);
    278279                async_req_2_0(exch, MOUSEEV_MOVE_EVENT, shift_x, shift_y);
    279280                async_exchange_end(exch);
     
    291292
    292293        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    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);
     294            &hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END
     295            | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, USB_HID_REPORT_TYPE_INPUT);
    296296
    297297        while (field != NULL) {
     
    314314                        async_req_2_0(exch, MOUSEEV_BUTTON_EVENT, field->usage, 0);
    315315                        async_exchange_end(exch);
    316                        
     316
    317317                        mouse_dev->buttons[field->usage - field->usage_minimum] =
    318318                           field->value;
    319319                }
    320                
     320
    321321                field = usb_hid_report_get_sibling(
    322                     hid_dev->report, field, path, USB_HID_PATH_COMPARE_END
    323                     | 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,
    324324                    USB_HID_REPORT_TYPE_INPUT);
    325325        }
     
    474474        // that the current solution is good enough.
    475475        /* Adding 1 because we will be accessing buttons[highest]. */
    476         mouse_dev->buttons_count = usb_mouse_get_highest_button(hid_dev->report,
    477             hid_dev->report_id) + 1;
     476        mouse_dev->buttons_count = 1 + usb_mouse_get_highest_button(
     477            &hid_dev->report, hid_dev->report_id);
    478478        mouse_dev->buttons = calloc(mouse_dev->buttons_count, sizeof(int32_t));
    479479
     
    532532int usb_mouse_set_boot_protocol(usb_hid_dev_t *hid_dev)
    533533{
    534         int rc = usb_hid_parse_report_descriptor(hid_dev->report,
    535             USB_MOUSE_BOOT_REPORT_DESCRIPTOR,
     534        int rc = usb_hid_parse_report_descriptor(
     535            &hid_dev->report, USB_MOUSE_BOOT_REPORT_DESCRIPTOR,
    536536            USB_MOUSE_BOOT_REPORT_DESCRIPTOR_SIZE);
    537537
     
    542542        }
    543543
    544         rc = usbhid_req_set_protocol(&hid_dev->usb_dev->ctrl_pipe, 
     544        rc = usbhid_req_set_protocol(&hid_dev->usb_dev->ctrl_pipe,
    545545            hid_dev->usb_dev->interface_no, USB_HID_PROTOCOL_BOOT);
    546546
Note: See TracChangeset for help on using the changeset viewer.