Changeset 70a71e5 in mainline
- Timestamp:
- 2011-04-01T13:18:42Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7787dd81, bda06a3
- Parents:
- ad7bb42
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbkbd/kbddev.c
rad7bb42 r70a71e5 276 276 // leds |= USB_HID_LED_NUM_LOCK; 277 277 } 278 else { 279 kbd_dev->led_data[i++] = 0; 280 } 278 281 279 282 if ((kbd_dev->mods & KM_CAPS_LOCK) && (i < kbd_dev->led_output_size)) { 280 283 kbd_dev->led_data[i++] = USB_HID_LED_CAPS_LOCK; 281 284 // leds |= USB_HID_LED_CAPS_LOCK; 285 } 286 else { 287 kbd_dev->led_data[i++] = 0; 282 288 } 283 289 … … 286 292 kbd_dev->led_data[i++] = USB_HID_LED_SCROLL_LOCK; 287 293 // leds |= USB_HID_LED_SCROLL_LOCK; 294 } 295 else { 296 kbd_dev->led_data[i++] = 0; 288 297 } 289 298 -
uspace/lib/usb/src/hidparser.c
rad7bb42 r70a71e5 1200 1200 } 1201 1201 1202 usb_log_debug("OUTPUT BUFFER: %s\n", usb_debug_str_buffer(buffer,size, 0)); 1203 usb_log_debug("OUTPUT DATA[0]: %d, DATA[1]: %d, DATA[2]: %d\n", data[0], data[1], data[2]); 1204 1202 1205 item = parser->output.next; 1203 1206 while(item != &parser->output) { … … 1208 1211 if(idx >= data_size) { 1209 1212 break; 1210 }1211 1212 // translate data1213 if(USB_HID_ITEM_FLAG_CONSTANT(report_item->item_flags)) {1214 value = report_item->logical_minimum;1215 }1216 else {1217 //variable item1218 value = usb_hid_translate_data_reverse(report_item, data[idx]);1219 idx++;1220 1213 } 1221 1214 … … 1224 1217 1225 1218 // // variable item 1219 value = usb_hid_translate_data_reverse(report_item, data[idx++]); 1226 1220 offset = report_item->offset + (i * report_item->size); 1227 1221 length = report_item->size; … … 1229 1223 else { 1230 1224 //bitmap 1225 value += usb_hid_translate_data_reverse(report_item, data[idx++]); 1231 1226 offset = report_item->offset; 1232 1227 length = report_item->size * report_item->count; … … 1243 1238 value = value << shift; 1244 1239 value = value & (((1 << length)-1) << shift); 1245 buffer[offset/8] = buffer[offset/8] | value; 1240 1241 uint8_t mask = 0; 1242 mask = 0xff - (((1 << length) - 1) << shift); 1243 buffer[offset/8] = (buffer[offset/8] & mask) | value; 1246 1244 } 1247 1245 else { … … 1253 1251 tmp_value = tmp_value << (offset%8); 1254 1252 1255 buffer[offset/8] = buffer[offset/8] | tmp_value; 1253 uint8_t mask = 0; 1254 mask = ~(((1 << (8-(offset%8)))-1) << (offset%8)); 1255 buffer[offset/8] = (buffer[offset/8] & mask) | tmp_value; 1256 1256 1257 1257 // a ted druhej -- hornich length-x bitu … … 1259 1259 value = value & ((1 << (length - (8 - (offset % 8)))) - 1); 1260 1260 1261 buffer[(offset+length-1)/8] = buffer[(offset+length-1)/8] | value; 1261 mask = ((1 << (length - (8 - (offset % 8)))) - 1); 1262 buffer[(offset+length-1)/8] = (buffer[(offset+length-1)/8] & mask) | value; 1262 1263 } 1263 1264 … … 1267 1268 } 1268 1269 1270 usb_log_debug("OUTPUT BUFFER: %s\n", usb_debug_str_buffer(buffer,size, 0)); 1269 1271 1270 1272 return EOK; … … 1281 1283 int ret=0; 1282 1284 int resolution; 1285 1286 if(USB_HID_ITEM_FLAG_CONSTANT(item->item_flags)) { 1287 ret = item->logical_minimum; 1288 } 1283 1289 1284 1290 if((USB_HID_ITEM_FLAG_VARIABLE(item->item_flags) == 0)) {
Note:
See TracChangeset
for help on using the changeset viewer.