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