36,7 → 36,9 |
* It takes care of low-level keyboard functions. |
*/ |
|
#include <genarch/i8042/i8042.h> |
#include <genarch/kbd/i8042.h> |
#include <genarch/kbd/scanc.h> |
#include <genarch/kbd/scanc_pc.h> |
#include <arch/drivers/i8042.h> |
#include <arch/interrupt.h> |
#include <cpu.h> |
78,11 → 80,6 |
|
#define KEY_RELEASE 0x80 |
|
/** |
* These codes read from i8042 data register are silently ignored. |
*/ |
#define IGNORE_CODE 0x7f |
|
static void key_released(uint8_t sc); |
static void key_pressed(uint8_t sc); |
static char key_read(chardev_t *d); |
390,13 → 387,11 |
while (!(i8042_status_read() & i8042_BUFFER_FULL_MASK)) |
; |
x = i8042_data_read(); |
if (x != IGNORE_CODE) { |
if (x & KEY_RELEASE) |
key_released(x ^ KEY_RELEASE); |
else |
active_read_key_pressed(x); |
} |
} |
return ch; |
} |
|
410,7 → 405,6 |
|
while (((x = i8042_status_read() & i8042_BUFFER_FULL_MASK))) { |
x = i8042_data_read(); |
if (x != IGNORE_CODE) { |
if (x & KEY_RELEASE) |
key_released(x ^ KEY_RELEASE); |
else |
417,8 → 411,6 |
key_pressed(x); |
} |
} |
} |
|
/** @} |
*/ |
|