Changeset 8fb45e08 in mainline


Ignore:
Timestamp:
2011-05-27T09:00:31Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3c9eb46
Parents:
ff41576d
Message:

Changed way of remembering if event was picked up.

  • Increasing event report number each time there is a new report.
Location:
uspace/drv/usbhid
Files:
2 edited

Legend:

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

    rff41576d r8fb45e08  
    6363static const int USB_HID_MAX_SUBDRIVERS = 10;
    6464
    65 static fibril_local bool report_received;
     65/** @todo What happens if this is not fibril local? */
     66//static fibril_local bool report_number;
    6667
    6768/*----------------------------------------------------------------------------*/
     
    361362       
    362363        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);*/
    365366       
    366367        size_t max_size = 0;
    367368       
    368369        do {
    369                 max_size = (size > max_size) ? size : max_size;
    370370                size = usb_hid_report_byte_size(hid_dev->report, report_id,
    371371                    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;
    372374                report_id = usb_hid_get_next_report_id(hid_dev->report,
    373375                    report_id, USB_HID_REPORT_TYPE_INPUT);
     
    578580        memcpy(hid_dev->input_report, buffer, buffer_size);
    579581        hid_dev->input_report_size = buffer_size;
    580         usb_hid_new_report();
     582        usb_hid_new_report(hid_dev);
    581583       
    582584        bool cont = false;
     
    654656/*----------------------------------------------------------------------------*/
    655657
    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 }
     658void usb_hid_new_report(usb_hid_dev_t *hid_dev)
     659{
     660        ++hid_dev->report_nr;
     661}
     662
     663/*----------------------------------------------------------------------------*/
     664
     665int 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//}
    674683
    675684/*----------------------------------------------------------------------------*/
  • uspace/drv/usbhid/usbhid.h

    rff41576d r8fb45e08  
    9999        size_t input_report_size;
    100100        size_t max_input_report_size;
     101       
     102        int report_nr;
    101103} usb_hid_dev_t;
    102104
     
    128130//const char *usb_hid_get_class_name(const usb_hid_dev_t *hid_dev);
    129131
    130 void usb_hid_new_report(void);
     132void usb_hid_new_report(usb_hid_dev_t *hid_dev);
    131133
    132 void usb_hid_report_received(void);
     134int usb_hid_report_number(usb_hid_dev_t *hid_dev);
    133135
    134 bool usb_hid_report_ready(void);
     136//void usb_hid_report_received(void);
     137
     138//bool usb_hid_report_ready(void);
    135139
    136140void usb_hid_free(usb_hid_dev_t **hid_dev);
Note: See TracChangeset for help on using the changeset viewer.