Changeset d477734 in mainline


Ignore:
Timestamp:
2011-03-06T17:28:35Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
24d5432, d2fc1c2
Parents:
b330cb1f
Message:

Phantom state handling (actually no handling, just ignoring).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/kbddev.c

    rb330cb1f rd477734  
    6363static const size_t BOOTP_BUFFER_SIZE = 8;
    6464static const size_t BOOTP_BUFFER_OUT_SIZE = 1;
     65static const uint8_t BOOTP_ERROR_ROLLOVER = 1;
    6566static const uint8_t IDLE_RATE = 0;
    6667
     
    319320    const uint8_t *key_codes)
    320321{
    321         // TODO: phantom state!!
    322        
    323322        unsigned int key;
    324323        unsigned int i, j;
     324       
     325        /*
     326         * First of all, check if the kbd have reported phantom state.
     327         */
     328        i = 0;
     329        // all fields should report Error Rollover
     330        while (i < kbd_dev->keycode_count &&
     331            key_codes[i] == BOOTP_ERROR_ROLLOVER) {
     332                ++i;
     333        }
     334        if (i == kbd_dev->keycode_count) {
     335                usb_log_debug("Phantom state occured.\n");
     336                // phantom state, do nothing
     337                return;
     338        }
    325339       
    326340        // TODO: quite dummy right now, think of better implementation
     
    341355                        key = usbhid_parse_scancode(kbd_dev->keycodes[j]);
    342356                        usbhid_kbd_push_ev(kbd_dev, KEY_RELEASE, key);
    343                         usb_log_debug2("\nKey released: %d\n", key);
     357                        usb_log_debug2("Key released: %d\n", key);
    344358                } else {
    345359                        // found, nothing happens
     
    361375                        // not found, i.e. new key pressed
    362376                        key = usbhid_parse_scancode(key_codes[i]);
    363                         usb_log_debug2("\nKey pressed: %d (keycode: %d)\n", key,
     377                        usb_log_debug2("Key pressed: %d (keycode: %d)\n", key,
    364378                            key_codes[i]);
    365379                        usbhid_kbd_push_ev(kbd_dev, KEY_PRESS, key);
     
    372386//              if (key_codes[i] != 0) {
    373387//                      key = usbhid_parse_scancode(key_codes[i]);
    374 //                      usb_log_debug2("\nKey pressed: %d (keycode: %d)\n", key,
     388//                      usb_log_debug2("Key pressed: %d (keycode: %d)\n", key,
    375389//                          key_codes[i]);
    376390//                      usbhid_kbd_push_ev(kbd_dev, KEY_PRESS, key);
Note: See TracChangeset for help on using the changeset viewer.