From dc18b75894d91046eb72bc8df4d822ed921a7de7 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 18 Aug 2018 20:15:36 +0100 Subject: [PATCH] sam: call the keyboard scanner --- Kernel/platform-sam/devtty.c | 30 +++++------------------------- Kernel/platform-sam/devtty.h | 1 + 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/Kernel/platform-sam/devtty.c b/Kernel/platform-sam/devtty.c index 78dfb7a0..14904ea1 100644 --- a/Kernel/platform-sam/devtty.c +++ b/Kernel/platform-sam/devtty.c @@ -61,8 +61,8 @@ uint8_t keyin[9]; static uint8_t keybyte, keybit; static uint8_t newkey; static int keysdown = 0; -static uint8_t shiftmask[8] = { - 0, 0, 0, 0, 0, 0, 0, 7 +static uint8_t shiftmask[9] = { + 0, 0, 0, 0, 0, 0, 0, 0, 7 }; static void keyproc(void) @@ -70,10 +70,9 @@ static void keyproc(void) int i; uint8_t key; - /* Call asm keyin here FIXME */ - for (i = 0; i < 8; i++) { - /* Set one of A0 to A7, and read the byte we get back. - Invert that to get a mask of pressed buttons */ + keyscan(); + + for (i = 0; i < 9; i++) { key = keyin[i] ^ keymap[i]; if (key) { int n; @@ -141,25 +140,6 @@ static void keydecode(void) if (keymap[7] & 4) { /* control */ if (c > 31 && c < 96) c &= 31; - if (keymap[7] & 3) { - if (c == '(') - c = '{'; - if (c == ')') - c = '}'; - if (c == '-') - c = '_'; - if (c == '/') - c = '``'; - if (c == '<') - c = '^'; - } else { - if (c == '(') - c = '['; - if (c == ')') - c = ']'; - if (c == '-') - c = '|'; - } } if (capslock && c >= 'a' && c <= 'z') c -= 'a' - 'A'; diff --git a/Kernel/platform-sam/devtty.h b/Kernel/platform-sam/devtty.h index bda124eb..336152db 100644 --- a/Kernel/platform-sam/devtty.h +++ b/Kernel/platform-sam/devtty.h @@ -3,5 +3,6 @@ extern void tty_interrupt(void); extern void kbd_interrupt(void); +extern void keyscan(void); #endif -- 2.34.1