Changeset f3b39b4 in mainline for uspace/lib/usbhid/src/hidparser.c


Ignore:
Timestamp:
2011-05-26T20:43:26Z (14 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d861c22
Parents:
14e1bcc
Message:

doxygen and coding style update

File:
1 edited

Legend:

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

    r14e1bcc rf3b39b4  
    167167        while(list_item != &(report_des->report_items)) {
    168168
    169                 item = list_get_instance(list_item, usb_hid_report_field_t, link);
     169                item = list_get_instance(list_item, usb_hid_report_field_t,
     170                                link);
    170171
    171172                if(USB_HID_ITEM_FLAG_CONSTANT(item->item_flags) == 0) {
     
    174175
    175176                                // array
    176                                 item->value = usb_hid_translate_data(item, data);
     177                                item->value =
     178                                        usb_hid_translate_data(item, data);
    177179               
    178180                                item->usage = USB_HID_EXTENDED_USAGE(
    179                                         item->usages[item->value - item->physical_minimum]);
     181                                    item->usages[item->value - item->physical_minimum]);
     182
    180183                                item->usage_page = USB_HID_EXTENDED_USAGE_PAGE(
    181                                         item->usages[item->value - item->physical_minimum]);                           
     184                                    item->usages[item->value - item->physical_minimum]);
    182185
    183186                                usb_hid_report_set_last_item (item->collection_path,
    184                                         USB_HID_TAG_CLASS_GLOBAL, item->usage_page);
     187                                    USB_HID_TAG_CLASS_GLOBAL, item->usage_page);
     188
    185189                                usb_hid_report_set_last_item (item->collection_path,
    186190                                    USB_HID_TAG_CLASS_LOCAL, item->usage);
     
    273277        }
    274278
    275         return (int)(((value - item->logical_minimum) / resolution) + item->physical_minimum);
     279        return (int)(((value - item->logical_minimum) / resolution) +
     280                item->physical_minimum);
    276281       
    277282}
     
    415420                                if(i == (offset/8)) {
    416421                                        tmp_value = value;
    417                                         tmp_value = tmp_value & ((1 << (8-(offset%8)))-1);                             
     422                                        tmp_value = tmp_value &
     423                                                ((1 << (8-(offset%8)))-1);
     424
    418425                                        tmp_value = tmp_value << (offset%8);
    419426       
    420                                         mask = ~(((1 << (8-(offset%8)))-1) << (offset%8));
    421                                         buffer[i] = (buffer[i] & mask) | tmp_value;                     
     427                                        mask = ~(((1 << (8-(offset%8)))-1) <<
     428                                                        (offset%8));
     429
     430                                        buffer[i] = (buffer[i] & mask) |
     431                                                tmp_value;
    422432                                }
    423433                                else if (i == ((offset + length -1)/8)) {
    424434                                       
    425                                         value = value >> (length - ((offset + length) % 8));
    426                                         value = value &
    427                                                 ((1 << (length - ((offset + length) % 8))) - 1);
     435                                        value = value >> (length -
     436                                                ((offset + length) % 8));
     437
     438                                        value = value & ((1 << (length -
     439                                                ((offset + length) % 8))) - 1);
    428440                               
    429                                         mask = (1 << (length - ((offset + length) % 8))) - 1;
     441                                        mask = (1 << (length -
     442                                                ((offset + length) % 8))) - 1;
     443
    430444                                        buffer[i] = (buffer[i] & mask) | value;
    431445                                }
     
    529543        usb_hid_report_type_t type)
    530544{
    531         usb_hid_report_description_t *report_des = usb_hid_report_find_description(
    532                 report, path->report_id, type);
     545        usb_hid_report_description_t *report_des =
     546                usb_hid_report_find_description(report, path->report_id, type);
    533547
    534548        link_t *field_it;
     
    546560
    547561        while(field_it != &report_des->report_items) {
    548                 field = list_get_instance(field_it, usb_hid_report_field_t, link);
     562                field = list_get_instance(field_it, usb_hid_report_field_t,
     563                        link);
    549564
    550565                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);
     566                        usb_hid_report_path_append_item (
     567                                field->collection_path, field->usage_page,
     568                                field->usage);
     569
     570                        if(usb_hid_report_compare_usage_path(
     571                                field->collection_path, path, flags) == EOK){
     572
     573                                usb_hid_report_remove_last_item(
     574                                        field->collection_path);
     575
    558576                                return field;
    559577                        }
    560                         usb_hid_report_remove_last_item (field->collection_path);
     578                        usb_hid_report_remove_last_item (
     579                                field->collection_path);
    561580                }
    562581                field_it = field_it->next;
Note: See TracChangeset for help on using the changeset viewer.