Fork us on GitHub Follow us on Facebook Follow us on Twitter

Ignore:
Timestamp:
2017-11-21T18:13:28Z (4 years ago)
Author:
Aearsis <Hlavaty.Ondrej@…>
Branches:
lfn, master
Children:
ae303ad
Parents:
6d91888
git-author:
Aearsis <Hlavaty.Ondrej@…> (2017-11-21 18:13:26)
git-committer:
Aearsis <Hlavaty.Ondrej@…> (2017-11-21 18:13:28)
Message:

usbhid: rewrite the way values are extracted

There was a bug, and I'm not able to find it. After the rewrite, it is
working as expected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhid/src/hiddescriptor.c

    r6d91888 r6283cefb  
    246246                field->size = report_item->size;
    247247
    248                 if(report_item->type == USB_HID_REPORT_TYPE_INPUT) {
    249                         int offset = report_item->offset + report_item->size * i;
    250                         int field_offset = (offset/8)*8 + (offset/8 + 1) * 8 -
    251                                 offset - report_item->size;
    252                         if(field_offset < 0) {
    253                                 field->offset = 0;
    254                         }
    255                         else {
    256                                 field->offset = field_offset;
    257                         }
    258                 }
    259                 else {
    260                         field->offset = report_item->offset + (i * report_item->size);
    261                 }
    262 
     248                field->offset = report_item->offset + (i * report_item->size);
    263249
    264250                if(report->use_report_ids != 0) {
     
    901887        list_foreach(*list, ritems_link, usb_hid_report_field_t,
    902888            report_item) {
    903                 usb_log_debug("\t\tOFFSET: %X\n", report_item->offset);
     889                usb_log_debug("\t\tOFFSET: %u\n", report_item->offset);
    904890                usb_log_debug("\t\tSIZE: %zu\n", report_item->size);
    905891                usb_log_debug("\t\tLOGMIN: %d\n",
Note: See TracChangeset for help on using the changeset viewer.