Changeset d600874 in mainline for uspace/lib/usbhid/src/hiddescriptor.c
- Timestamp:
- 2011-05-30T11:40:58Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b2387c2
- Parents:
- 98e15b1 (diff), 3dfdcb7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/src/hiddescriptor.c
r98e15b1 rd600874 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); … … 216 220 } 217 221 else { 218 usage = 222 usage = report_item->usages[ 219 223 report_item->usages_count- 1]; 220 224 } … … 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 int offset = report_item->offset + report_item->size * i; 250 int field_offset = (offset/8)*8 + (offset/8 + 1) * 8 - 251 offset - report_item->size; 252 if(field_offset < 0) { 253 field->offset = 0; 254 } 255 else { 256 field->offset = field_offset; 257 } 258 } 259 else { 260 field->offset = report_item->offset + (i * report_item->size); 261 } 262 263 264 if(report->use_report_ids != 0) { 252 265 field->offset += 8; 253 266 report->use_report_ids = 1; 254 267 } 268 255 269 field->item_flags = report_item->item_flags; 256 270
Note:
See TracChangeset
for help on using the changeset viewer.