diff options
Diffstat (limited to 'app/atkbd.c')
-rw-r--r-- | app/atkbd.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/app/atkbd.c b/app/atkbd.c index 8191f2f..9091636 100644 --- a/app/atkbd.c +++ b/app/atkbd.c @@ -65,9 +65,6 @@ typedef enum #define ATKBD_KEY_UNKNOWN 0 #define ATKBD_KEY_NULL 255 -#define LED_CAPS 0x01 -#define LED_NUMLOCK 0x02 -#define LED_SCROLLOCK 0x04 @@ -97,9 +94,6 @@ cycle_diff (uint32_t a, uint32_t b) return b - a; } - - - static void atkbd_dispatch (int key, int updown) { @@ -114,9 +108,10 @@ atkbd_dispatch (int key, int updown) } - if (key == 0x84) + if (key == (AT_BS_EMUL0 | AT_SC_KPASTERISK)) key = AT_SC_SYSRQ; - if (key == 0x77) + + if (key == AT_SC_NUMLOCK) { /*Grr broken MS state machine in docs */ if ((!updown) && (pause_down)) @@ -152,7 +147,9 @@ atkbd_data_dispatch (uint8_t byte) static int release; static int emul; -// printf ("ATKBD < 0x%02x\r\n", byte); +#ifdef DEBUG + printf ("ATKBD < 0x%02x\r\n", byte); +#endif switch (byte) { @@ -338,7 +335,9 @@ atkbd_send (uint8_t d) atkbd_unmask_flush_irq (); -// printf ("ATKBD > 0x%02x\r\n", d); +#ifdef DEBUG + printf ("ATKBD > 0x%02x\r\n", d); +#endif return 0; @@ -353,7 +352,9 @@ err: atkbd_unmask_flush_irq (); -// printf ("ATKBD >! 0x%02x\r\n", d); +#ifdef DEBUG + printf ("ATKBD >! 0x%02x\r\n", d); +#endif return -1; } @@ -481,7 +482,7 @@ atkbd_init (void) atkbd_request_echo (); atkbd_set_mbr (); atkbd_set_scanset (2); - atkbd_set_leds (LED_CAPS); + atkbd_set_leds (0); } |