Changeset 33382a9 in mainline


Ignore:
Timestamp:
2011-03-11T16:56:00Z (13 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c32688d
Parents:
0bd4810c
Message:

#128 - skip constant items in report

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/hidparser.c

    r0bd4810c r33382a9  
    607607
    608608        // get the size of result keycodes array
    609         list_item = parser->input.next;   
    610         while(list_item != &(parser->input)) {
    611 
    612                 item = list_get_instance(list_item, usb_hid_report_item_t, link);
    613                 if(item->usage_page == BAD_HACK_USAGE_PAGE) {
    614                         key_count += item->count;
    615                 }
    616 
    617                 list_item = list_item->next;
    618         }
    619 
    620        
     609        usb_hid_report_path_t path;
     610        path.usage_page = BAD_HACK_USAGE_PAGE;
     611        key_count = usb_hid_report_input_length(parser, &path);
     612
    621613        if(!(keys = malloc(sizeof(uint8_t) * key_count))){
    622614                return ENOMEM;
     
    628620
    629621                item = list_get_instance(list_item, usb_hid_report_item_t, link);
    630                 if(item->usage_page == BAD_HACK_USAGE_PAGE) {
     622                if(!USB_HID_ITEM_FLAG_CONSTANT(item->item_flags) &&
     623                   (item->usage_page == BAD_HACK_USAGE_PAGE)) {
    631624                        for(j=0; j<(size_t)(item->count); j++) {
    632625                                keys[i++] = usb_hid_translate_data(item, data,j);
     
    730723        while(&parser->input != item) {
    731724                report_item = list_get_instance(item, usb_hid_report_item_t, link);
    732                 if(report_item->usage_page == path->usage_page) {
     725                if(!USB_HID_ITEM_FLAG_CONSTANT(report_item->item_flags) &&
     726                   (report_item->usage_page == path->usage_page)) {
    733727                        ret += report_item->count;
    734728                }
Note: See TracChangeset for help on using the changeset viewer.