From 7e6bf358d84b413b7a402079b130a9a2a1222d74 Mon Sep 17 00:00:00 2001 From: wdenk Date: Sun, 12 Dec 2004 22:06:17 +0000 Subject: Patch by Martin Krause, 27 Oct 2004: - add support for "STK52xx" board (including PS/2 multiplexer) - add hardware detection for TQM5200 --- drivers/keyboard.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'drivers/keyboard.c') diff --git a/drivers/keyboard.c b/drivers/keyboard.c index a42468f0c6a..f12de838f36 100644 --- a/drivers/keyboard.c +++ b/drivers/keyboard.c @@ -33,6 +33,10 @@ #define KBD_BUFFER_LEN 0x20 /* size of the keyboardbuffer */ +#ifdef CONFIG_MPC5xxx +int ps2ser_check(void); +#endif + static volatile char kbd_buffer[KBD_BUFFER_LEN]; static volatile int in_pointer = 0; static volatile int out_pointer = 0; @@ -71,6 +75,10 @@ static void kbd_put_queue(char data) /* test if a character is in the queue */ static int kbd_testc(void) { +#ifdef CONFIG_MPC5xxx + /* no ISR is used, so received chars must be polled */ + ps2ser_check(); +#endif if(in_pointer==out_pointer) return(0); /* no data */ else @@ -81,7 +89,12 @@ static int kbd_testc(void) static int kbd_getc(void) { char c; - while(in_pointer==out_pointer); + while(in_pointer==out_pointer) { +#ifdef CONFIG_MPC5xxx + /* no ISR is used, so received chars must be polled */ + ps2ser_check(); +#endif + ;} if((out_pointer+1)==KBD_BUFFER_LEN) out_pointer=0; else -- cgit v1.2.3