Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 252cf2a in mainline for uspace/drv/usbhid/kbd/kbddev.c


Ignore:
Timestamp:
2011-05-08T15:53:44Z (11 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master
Children:
f55ded3
Parents:
cc5908e
Message:

Development changes merge
Correct parsing of usages in case of array items

File:
1 edited

Legend:

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

    rcc5908e r252cf2a  
    677677//          callbacks, kbd_dev);
    678678        usb_hid_report_path_t *path = usb_hid_report_path();
    679         usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
     679        usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_GENERIC_DESKTOP, 6);
    680680        //usb_hid_report_path_set_report_id(path, 0);
    681681
     
    695695        usb_hid_report_field_t *field = usb_hid_report_get_sibling(
    696696            hid_dev->report, NULL, path,
    697             USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     697            USB_HID_PATH_COMPARE_BEGIN,
    698698            USB_HID_REPORT_TYPE_INPUT);
    699699        unsigned i = 0;
    700        
     700
    701701        while (field != NULL) {
    702702                //usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n",
     
    716716                 *       two parts of the Report somehow.
    717717                 */
     718                usb_log_debug("value(%x), usage(%x)\n", field->value, field->usage);
    718719                if (field->value != 0) {
    719                         kbd_dev->keys[i] = field->usage;
     720                        //kbd_dev->keys[i] = field->usage;
    720721                }
    721722                else {
    722                         kbd_dev->keys[i] = 0;
     723                        //kbd_dev->keys[i] = 0;
    723724                }
    724                 usb_log_debug2("Saved %u. key usage %d\n", i, kbd_dev->keys[i]);
     725                //usb_log_debug2("Saved %u. key usage %d\n", i, kbd_dev->keys[i]);
    725726               
    726727                ++i;
    727728                field = usb_hid_report_get_sibling(hid_dev->report, field, path,
    728                     USB_HID_PATH_COMPARE_END
    729                     | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
     729                    USB_HID_PATH_COMPARE_BEGIN,
    730730                    USB_HID_REPORT_TYPE_INPUT);
     731                usb_log_debug("field -- %p\n", field);
    731732        }
    732733       
     
    860861         * TODO: make more general
    861862         */
    862         usb_hid_report_path_t *path = usb_hid_report_path();
    863         usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
    864        
    865         usb_hid_report_path_set_report_id(path, 0);
    866        
    867863        kbd_dev->key_count = usb_hid_report_size(
    868864            hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT);
    869         usb_hid_report_path_free(path);
    870        
    871         usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count);
    872        
     865       
     866        usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count);   
    873867        kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t));
    874868       
     
    986980                return rc;
    987981        }
    988        
     982
    989983        return EOK;
    990984}
Note: See TracChangeset for help on using the changeset viewer.