Changes in uspace/lib/usbhid/src/hidparser.c [14e1bcc:d861c22] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/src/hidparser.c
r14e1bcc rd861c22 119 119 } 120 120 else { 121 if(report_id == 0) { 122 return ((report_des->bit_length + 7) / 8) ; 123 } 124 else { 125 return 1 + ((report_des->bit_length + 7) / 8); 126 } 121 return ((report_des->bit_length + 7) / 8) ; 127 122 } 128 123 } … … 167 162 while(list_item != &(report_des->report_items)) { 168 163 169 item = list_get_instance(list_item, usb_hid_report_field_t, link); 164 item = list_get_instance(list_item, usb_hid_report_field_t, 165 link); 170 166 171 167 if(USB_HID_ITEM_FLAG_CONSTANT(item->item_flags) == 0) { … … 174 170 175 171 // array 176 item->value = usb_hid_translate_data(item, data); 172 item->value = 173 usb_hid_translate_data(item, data); 177 174 178 175 item->usage = USB_HID_EXTENDED_USAGE( 179 item->usages[item->value - item->physical_minimum]); 176 item->usages[item->value - item->physical_minimum]); 177 180 178 item->usage_page = USB_HID_EXTENDED_USAGE_PAGE( 181 item->usages[item->value - item->physical_minimum]);179 item->usages[item->value - item->physical_minimum]); 182 180 183 181 usb_hid_report_set_last_item (item->collection_path, 184 USB_HID_TAG_CLASS_GLOBAL, item->usage_page); 182 USB_HID_TAG_CLASS_GLOBAL, item->usage_page); 183 185 184 usb_hid_report_set_last_item (item->collection_path, 186 185 USB_HID_TAG_CLASS_LOCAL, item->usage); … … 273 272 } 274 273 275 return (int)(((value - item->logical_minimum) / resolution) + item->physical_minimum); 274 return (int)(((value - item->logical_minimum) / resolution) + 275 item->physical_minimum); 276 276 277 277 } … … 415 415 if(i == (offset/8)) { 416 416 tmp_value = value; 417 tmp_value = tmp_value & ((1 << (8-(offset%8)))-1); 417 tmp_value = tmp_value & 418 ((1 << (8-(offset%8)))-1); 419 418 420 tmp_value = tmp_value << (offset%8); 419 421 420 mask = ~(((1 << (8-(offset%8)))-1) << (offset%8)); 421 buffer[i] = (buffer[i] & mask) | tmp_value; 422 mask = ~(((1 << (8-(offset%8)))-1) << 423 (offset%8)); 424 425 buffer[i] = (buffer[i] & mask) | 426 tmp_value; 422 427 } 423 428 else if (i == ((offset + length -1)/8)) { 424 429 425 value = value >> (length - ((offset + length) % 8)); 426 value = value & 427 ((1 << (length - ((offset + length) % 8))) - 1); 430 value = value >> (length - 431 ((offset + length) % 8)); 432 433 value = value & ((1 << (length - 434 ((offset + length) % 8))) - 1); 428 435 429 mask = (1 << (length - ((offset + length) % 8))) - 1; 436 mask = (1 << (length - 437 ((offset + length) % 8))) - 1; 438 430 439 buffer[i] = (buffer[i] & mask) | value; 431 440 } … … 529 538 usb_hid_report_type_t type) 530 539 { 531 usb_hid_report_description_t *report_des = usb_hid_report_find_description(532 report, path->report_id, type);540 usb_hid_report_description_t *report_des = 541 usb_hid_report_find_description(report, path->report_id, type); 533 542 534 543 link_t *field_it; … … 546 555 547 556 while(field_it != &report_des->report_items) { 548 field = list_get_instance(field_it, usb_hid_report_field_t, link); 557 field = list_get_instance(field_it, usb_hid_report_field_t, 558 link); 549 559 550 560 if(USB_HID_ITEM_FLAG_CONSTANT(field->item_flags) == 0) { 551 usb_hid_report_path_append_item (field->collection_path, 552 field->usage_page, field->usage); 553 554 if(usb_hid_report_compare_usage_path(field->collection_path, path, 555 flags) == EOK){ 556 557 usb_hid_report_remove_last_item(field->collection_path); 561 usb_hid_report_path_append_item ( 562 field->collection_path, field->usage_page, 563 field->usage); 564 565 if(usb_hid_report_compare_usage_path( 566 field->collection_path, path, flags) == EOK){ 567 568 usb_hid_report_remove_last_item( 569 field->collection_path); 570 558 571 return field; 559 572 } 560 usb_hid_report_remove_last_item (field->collection_path); 573 usb_hid_report_remove_last_item ( 574 field->collection_path); 561 575 } 562 576 field_it = field_it->next;
Note:
See TracChangeset
for help on using the changeset viewer.