Changeset 574f276 in mainline for uspace/lib/usbhid/src/hiddescriptor.c
- Timestamp:
- 2011-05-27T17:37:21Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4967c1e
- Parents:
- 0c904a3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/src/hiddescriptor.c
r0c904a3 r574f276 187 187 188 188 field = malloc(sizeof(usb_hid_report_field_t)); 189 if(field == NULL) { 190 return ENOMEM; 191 } 192 189 193 memset(field, 0, sizeof(usb_hid_report_field_t)); 190 194 list_initialize(&field->link); … … 241 245 242 246 field->size = report_item->size; 243 244 size_t offset_byte = (report_item->offset + (i * 245 report_item->size)) / 8; 246 247 size_t offset_bit = 8 - ((report_item->offset + (i * 248 report_item->size)) % 8) - report_item->size; 249 250 field->offset = 8 * offset_byte + offset_bit; 251 if(report_item->id != 0) { 247 248 if(report_item->type == USB_HID_REPORT_TYPE_INPUT) { 249 field->offset = report_item->offset + 250 ((report_item->count - (i + 1)) * 251 report_item->size); 252 } 253 else { 254 field->offset = report_item->offset + (i * report_item->size); 255 } 256 257 if(report->use_report_ids != 0) { 252 258 field->offset += 8; 253 259 report->use_report_ids = 1;
Note:
See TracChangeset
for help on using the changeset viewer.