Changes in uspace/lib/usbhid/src/hidparser.c [8242dd86:d861c22] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/src/hidparser.c
r8242dd86 rd861c22 153 153 154 154 155 report_des = usb_hid_report_find_description(report, *report_id, 156 type); 157 155 report_des = usb_hid_report_find_description(report, *report_id, type); 158 156 if(report_des == NULL) { 159 157 return EINVAL; … … 169 167 if(USB_HID_ITEM_FLAG_CONSTANT(item->item_flags) == 0) { 170 168 171 if(USB_HID_ITEM_FLAG_VARIABLE(item->item_flags) == 0) {169 if(USB_HID_ITEM_FLAG_VARIABLE(item->item_flags) == 0) { 172 170 173 171 // array … … 176 174 177 175 item->usage = USB_HID_EXTENDED_USAGE( 178 item->usages[ 179 item->value - item->physical_minimum]); 180 181 item->usage_page = 182 USB_HID_EXTENDED_USAGE_PAGE( 183 item->usages[ 184 item->value - item->physical_minimum]); 185 186 usb_hid_report_set_last_item ( 187 item->collection_path, 188 USB_HID_TAG_CLASS_GLOBAL, 189 item->usage_page); 190 191 usb_hid_report_set_last_item ( 192 item->collection_path, 176 item->usages[item->value - item->physical_minimum]); 177 178 item->usage_page = USB_HID_EXTENDED_USAGE_PAGE( 179 item->usages[item->value - item->physical_minimum]); 180 181 usb_hid_report_set_last_item (item->collection_path, 182 USB_HID_TAG_CLASS_GLOBAL, item->usage_page); 183 184 usb_hid_report_set_last_item (item->collection_path, 193 185 USB_HID_TAG_CLASS_LOCAL, item->usage); 194 186 … … 196 188 else { 197 189 // variable item 198 item->value = usb_hid_translate_data(item, 199 data); 190 item->value = usb_hid_translate_data(item, data); 200 191 } 201 192 } … … 222 213 223 214 int32_t value=0; 224 int32_t mask =0;225 const uint8_t *foo =0;215 int32_t mask; 216 const uint8_t *foo; 226 217 227 218 // now only shot tags are allowed … … 249 240 if((size_t)(offset/8) != (size_t)((offset+item->size-1)/8)) { 250 241 251 part_size = 0;242 part_size = ((offset+item->size)%8); 252 243 253 244 size_t i=0; … … 255 246 if(i == (size_t)(offset/8)) { 256 247 // the higher one 257 part_size = 8 - (offset % 8);258 248 foo = data + i; 259 249 mask = ((1 << (item->size-part_size))-1); … … 269 259 value = value << 8; 270 260 value += *(data + 1); 271 part_size += 8;272 261 } 273 262 }
Note:
See TracChangeset
for help on using the changeset viewer.