Changeset e4153ea in mainline
- Timestamp:
- 2011-04-01T14:34:18Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1b9c0e2, 966acede
- Parents:
- 7787dd81
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbkbd/kbddev.c
r7787dd81 re4153ea 70 70 static const unsigned DEFAULT_ACTIVE_MODS = KM_NUM_LOCK; 71 71 72 /** Boot protocol report size (key part). */ 73 static const size_t BOOTP_REPORT_SIZE = 6; 74 75 /** Boot protocol total report size. */ 76 static const size_t BOOTP_BUFFER_SIZE = 8; 77 78 /** Boot protocol output report size. */ 79 static const size_t BOOTP_BUFFER_OUT_SIZE = 1; 80 81 /** Boot protocol error key code. */ 82 static const uint8_t BOOTP_ERROR_ROLLOVER = 1; 72 ///** Boot protocol report size (key part). */ 73 //static const size_t BOOTP_REPORT_SIZE = 6; 74 75 ///** Boot protocol total report size. */ 76 //static const size_t BOOTP_BUFFER_SIZE = 8; 77 78 ///** Boot protocol output report size. */ 79 //static const size_t BOOTP_BUFFER_OUT_SIZE = 1; 80 81 ///** Boot protocol error key code. */ 82 //static const uint8_t BOOTP_ERROR_ROLLOVER = 1; 83 static const uint8_t ERROR_ROLLOVER = 1; 83 84 84 85 /** Default idle rate for keyboards. */ … … 264 265 static void usb_kbd_set_led(usb_kbd_t *kbd_dev) 265 266 { 266 // uint8_t buffer[BOOTP_BUFFER_OUT_SIZE];267 // int rc= 0;268 269 // memset(buffer, 0, BOOTP_BUFFER_OUT_SIZE);270 // uint8_t leds = 0;271 272 267 unsigned i = 0; 273 268 … … 277 272 if ((kbd_dev->mods & KM_NUM_LOCK) && (i < kbd_dev->led_output_size)) { 278 273 kbd_dev->led_data[i++] = USB_HID_LED_NUM_LOCK; 279 // leds |= USB_HID_LED_NUM_LOCK;280 274 } 281 275 282 276 if ((kbd_dev->mods & KM_CAPS_LOCK) && (i < kbd_dev->led_output_size)) { 283 277 kbd_dev->led_data[i++] = USB_HID_LED_CAPS_LOCK; 284 // leds |= USB_HID_LED_CAPS_LOCK;285 278 } 286 279 … … 288 281 && (i < kbd_dev->led_output_size)) { 289 282 kbd_dev->led_data[i++] = USB_HID_LED_SCROLL_LOCK; 290 // leds |= USB_HID_LED_SCROLL_LOCK;291 }292 293 usb_log_debug("Output report data: ");294 for (i = 0; i < kbd_dev->led_output_size; ++i) {295 usb_log_debug("%u: %d", i, kbd_dev->led_data[i]);296 283 } 297 284 … … 309 296 return; 310 297 } 311 312 // if ((rc = usb_hid_boot_keyboard_output_report(313 // leds, buffer, BOOTP_BUFFER_OUT_SIZE)) != EOK) {314 // usb_log_warning("Error composing output report to the keyboard:"315 // "%s.\n", str_error(rc));316 // return;317 // }318 298 319 299 usb_log_debug("Output report buffer: %s\n", … … 474 454 * First of all, check if the kbd have reported phantom state. 475 455 * 476 * this must be changed as we don't know which keys are modifiers 477 * and which are regular keys. 456 * As there is no way to distinguish keys from modifiers, we do not have 457 * a way to check that 'all keys report Error Rollover'. We thus check 458 * if there is at least one such error and in such case we ignore the 459 * whole input report. 478 460 */ 479 461 i = 0; 480 // all fields should report Error Rollover 481 while (i < count && 482 key_codes[i] == BOOTP_ERROR_ROLLOVER) { 462 while (i < count && key_codes[i] != ERROR_ROLLOVER) { 483 463 ++i; 484 464 } 485 if (i == count) {465 if (i != count) { 486 466 usb_log_debug("Phantom state occured.\n"); 487 467 // phantom state, do nothing
Note:
See TracChangeset
for help on using the changeset viewer.