Ignore:
File:
1 edited

Legend:

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

    r65c3794 r19e0560e  
    225225
    226226static bool usb_mouse_process_report(usb_hid_dev_t *hid_dev,
    227                                      usb_mouse_t *mouse_dev/*, uint8_t *buffer,
    228                                      size_t buffer_size*/)
     227                                     usb_mouse_t *mouse_dev, uint8_t *buffer,
     228                                     size_t buffer_size)
    229229{
    230230        assert(mouse_dev != NULL);
    231231       
    232 //      usb_log_debug2("got buffer: %s.\n",
    233 //          usb_debug_str_buffer(buffer, buffer_size, 0));
     232        usb_log_debug2("got buffer: %s.\n",
     233            usb_debug_str_buffer(buffer, buffer_size, 0));
    234234       
    235235        if (mouse_dev->mouse_phone < 0) {
     
    242242         */
    243243       
    244 //      usb_log_debug(NAME " Calling usb_hid_parse_report() with "
    245 //          "buffer %s\n", usb_debug_str_buffer(buffer, buffer_size, 0));
    246        
    247 //      uint8_t report_id;
    248        
    249 //      int rc = usb_hid_parse_report(hid_dev->report, buffer, buffer_size,
    250 //          &report_id);
    251        
    252 //      if (rc != EOK) {
    253 //              usb_log_warning(NAME "Error in usb_hid_parse_report(): %s\n",
    254 //                  str_error(rc));
    255 //              return true;
    256 //      }
     244        usb_log_debug(NAME " Calling usb_hid_parse_report() with "
     245            "buffer %s\n", usb_debug_str_buffer(buffer, buffer_size, 0));
     246       
     247        uint8_t report_id;
     248       
     249        int rc = usb_hid_parse_report(hid_dev->report, buffer, buffer_size,
     250            &report_id);
     251       
     252        if (rc != EOK) {
     253                usb_log_warning(NAME "Error in usb_hid_parse_report(): %s\n",
     254                    str_error(rc));
     255                return true;
     256        }
    257257       
    258258        /*
     
    265265            USB_HIDUT_USAGE_GENERIC_DESKTOP_X);
    266266
    267         usb_hid_report_path_set_report_id(path, hid_dev->report_id);
     267        usb_hid_report_path_set_report_id(path, report_id);
    268268
    269269        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
     
    288288            USB_HIDUT_USAGE_GENERIC_DESKTOP_Y);
    289289
    290         usb_hid_report_path_set_report_id(path, hid_dev->report_id);
     290        usb_hid_report_path_set_report_id(path, report_id);
    291291
    292292        field = usb_hid_report_get_sibling(
     
    316316            USB_HIDUT_USAGE_GENERIC_DESKTOP_WHEEL);
    317317
    318         usb_hid_report_path_set_report_id(path, hid_dev->report_id);
     318        usb_hid_report_path_set_report_id(path, report_id);
    319319       
    320320        field = usb_hid_report_get_sibling(
     
    340340        path = usb_hid_report_path();
    341341        usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_BUTTON, 0);
    342         usb_hid_report_path_set_report_id(path, hid_dev->report_id);
     342        usb_hid_report_path_set_report_id(path, report_id);
    343343       
    344344        field = usb_hid_report_get_sibling(
     
    505505/*----------------------------------------------------------------------------*/
    506506
    507 bool usb_mouse_polling_callback(usb_hid_dev_t *hid_dev, void *data/*,
    508      uint8_t *buffer, size_t buffer_size*/)
     507bool usb_mouse_polling_callback(usb_hid_dev_t *hid_dev, void *data,
     508     uint8_t *buffer, size_t buffer_size)
    509509{
    510510        usb_log_debug("usb_mouse_polling_callback()\n");
    511 //      usb_debug_str_buffer(buffer, buffer_size, 0);
     511        usb_debug_str_buffer(buffer, buffer_size, 0);
    512512       
    513513        if (hid_dev == NULL || data == NULL) {
     
    519519        usb_mouse_t *mouse_dev = (usb_mouse_t *)data;
    520520               
    521         return usb_mouse_process_report(hid_dev, mouse_dev/*, buffer,
    522                                         buffer_size*/);
     521        return usb_mouse_process_report(hid_dev, mouse_dev, buffer,
     522                                        buffer_size);
    523523}
    524524
Note: See TracChangeset for help on using the changeset viewer.