Changeset 68b614e in mainline for uspace/lib/usb/src/hiddescriptor.c
- Timestamp:
- 2011-05-08T16:00:58Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f50f722
- Parents:
- cc5908e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hiddescriptor.c
rcc5908e r68b614e 64 64 { 65 65 /* find or append current collection path to the list */ 66 link_t *path_it = report->collection_paths.next; 66 //link_t *path_it = report->collection_paths.next; 67 link_t *path_it = report->collection_paths.prev->next; 67 68 usb_hid_report_path_t *path = NULL; 69 70 68 71 while(path_it != &report->collection_paths) { 69 72 path = list_get_instance(path_it, usb_hid_report_path_t, link); … … 115 118 usb_hid_report_field_t *field; 116 119 int i; 117 118 usb_log_debug("usages_count - %zu\n", report_item->usages_count);119 120 120 121 uint32_t *usages; … … 147 148 */ 148 149 field->usage = 0; 149 field->usage_page = report_item->usage_page;150 field->usage_page = 0; //report_item->usage_page; 150 151 151 152 field->usages_count = report_item->usages_count; … … 168 169 } 169 170 else { 171 // should not occur 170 172 field->usage = usage; 171 173 field->usage_page = report_item->usage_page; … … 465 467 466 468 // set last item 467 usb_hid_report_set_last_item(usage_path, USB_HID_TAG_CLASS_GLOBAL, report_item->usage_page); 468 usb_hid_report_set_last_item(usage_path, USB_HID_TAG_CLASS_LOCAL, report_item->usages[report_item->usages_count-1]); 469 usb_hid_report_set_last_item(usage_path, 470 USB_HID_TAG_CLASS_GLOBAL, 471 USB_HID_EXTENDED_USAGE_PAGE(report_item->usages[report_item->usages_count-1])); 472 usb_hid_report_set_last_item(usage_path, 473 USB_HID_TAG_CLASS_LOCAL, 474 USB_HID_EXTENDED_USAGE(report_item->usages[report_item->usages_count-1])); 469 475 470 476 // append the new one which will be set by common … … 561 567 usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path) 562 568 { 569 int32_t extended_usage; 570 563 571 switch(tag) { 564 572 case USB_HID_REPORT_TAG_USAGE: … … 570 578 report_item->in_delimiter = INSIDE_DELIMITER_SET; 571 579 case OUTSIDE_DELIMITER_SET: 572 report_item->usages[report_item->usages_count] = usb_hid_report_tag_data_uint32(data,item_size); 580 extended_usage = ((report_item->usage_page) << 16); 581 extended_usage += usb_hid_report_tag_data_uint32(data,item_size); 582 report_item->usages[report_item->usages_count] = extended_usage; 573 583 report_item->usages_count++; 574 584 break; … … 607 617 } 608 618 else { 609 report_item->usages[report_item->usages_count++] = i; 619 620 report_item->usages[report_item->usages_count++] = (report_item->usage_page << 16) + i; 610 621 } 611 622 } … … 691 702 usb_log_debug("\t\ttUSAGEMIN: %X\n", report_item->usage_minimum); 692 703 usb_log_debug("\t\tUSAGEMAX: %X\n", report_item->usage_maximum); 704 usb_log_debug("\t\tUSAGES COUNT: %zu\n", report_item->usages_count); 693 705 694 706 usb_log_debug("\t\tVALUE: %X\n", report_item->value); … … 696 708 usb_log_debug("\t\tUSAGE PAGE: %X\n", report_item->usage_page); 697 709 698 //usb_hid_print_usage_path(report_item->collection_path);710 usb_hid_print_usage_path(report_item->collection_path); 699 711 700 712 usb_log_debug("\n"); … … 728 740 usb_hid_descriptor_print_list(&report_des->report_items); 729 741 730 742 /* 731 743 link_t *path_it = report->collection_paths.next; 732 744 while(path_it != &report->collection_paths) { … … 734 746 path_it = path_it->next; 735 747 } 736 748 */ 737 749 report_it = report_it->next; 738 750 }
Note:
See TracChangeset
for help on using the changeset viewer.