Changeset 8fb45e08 in mainline
- Timestamp:
- 2011-05-27T09:00:31Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3c9eb46
- Parents:
- ff41576d
- Location:
- uspace/drv/usbhid
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/usbhid.c
rff41576d r8fb45e08 63 63 static const int USB_HID_MAX_SUBDRIVERS = 10; 64 64 65 static fibril_local bool report_received; 65 /** @todo What happens if this is not fibril local? */ 66 //static fibril_local bool report_number; 66 67 67 68 /*----------------------------------------------------------------------------*/ … … 361 362 362 363 uint8_t report_id = 0; 363 size_t size = usb_hid_report_byte_size(hid_dev->report, report_id,364 USB_HID_REPORT_TYPE_INPUT); 364 size_t size;/* = usb_hid_report_byte_size(hid_dev->report, report_id, 365 USB_HID_REPORT_TYPE_INPUT);*/ 365 366 366 367 size_t max_size = 0; 367 368 368 369 do { 369 max_size = (size > max_size) ? size : max_size;370 370 size = usb_hid_report_byte_size(hid_dev->report, report_id, 371 371 USB_HID_REPORT_TYPE_INPUT); 372 usb_log_debug("Report ID: %u, size: %zu\n", report_id, size); 373 max_size = (size > max_size) ? size : max_size; 372 374 report_id = usb_hid_get_next_report_id(hid_dev->report, 373 375 report_id, USB_HID_REPORT_TYPE_INPUT); … … 578 580 memcpy(hid_dev->input_report, buffer, buffer_size); 579 581 hid_dev->input_report_size = buffer_size; 580 usb_hid_new_report( );582 usb_hid_new_report(hid_dev); 581 583 582 584 bool cont = false; … … 654 656 /*----------------------------------------------------------------------------*/ 655 657 656 void usb_hid_new_report(void) 657 { 658 report_received = false; 659 } 660 661 /*----------------------------------------------------------------------------*/ 662 663 void usb_hid_report_received(void) 664 { 665 report_received = true; 666 } 667 668 /*----------------------------------------------------------------------------*/ 669 670 bool usb_hid_report_ready(void) 671 { 672 return !report_received; 673 } 658 void usb_hid_new_report(usb_hid_dev_t *hid_dev) 659 { 660 ++hid_dev->report_nr; 661 } 662 663 /*----------------------------------------------------------------------------*/ 664 665 int usb_hid_report_number(usb_hid_dev_t *hid_dev) 666 { 667 return hid_dev->report_nr; 668 } 669 670 /*----------------------------------------------------------------------------*/ 671 672 //void usb_hid_report_received(void) 673 //{ 674 // ++report_number; 675 //} 676 677 /*----------------------------------------------------------------------------*/ 678 679 //bool usb_hid_report_ready(void) 680 //{ 681 // return !report_received; 682 //} 674 683 675 684 /*----------------------------------------------------------------------------*/ -
uspace/drv/usbhid/usbhid.h
rff41576d r8fb45e08 99 99 size_t input_report_size; 100 100 size_t max_input_report_size; 101 102 int report_nr; 101 103 } usb_hid_dev_t; 102 104 … … 128 130 //const char *usb_hid_get_class_name(const usb_hid_dev_t *hid_dev); 129 131 130 void usb_hid_new_report( void);132 void usb_hid_new_report(usb_hid_dev_t *hid_dev); 131 133 132 void usb_hid_report_received(void);134 int usb_hid_report_number(usb_hid_dev_t *hid_dev); 133 135 134 bool usb_hid_report_ready(void); 136 //void usb_hid_report_received(void); 137 138 //bool usb_hid_report_ready(void); 135 139 136 140 void usb_hid_free(usb_hid_dev_t **hid_dev);
Note:
See TracChangeset
for help on using the changeset viewer.