version 1.1.1.1, 2008/06/03 10:38:41 |
version 1.1.1.1.2.1, 2008/08/13 17:12:22 |
|
|
#include <driver.h> |
#include <driver.h> |
#include <prex/keycode.h> |
#include <prex/keycode.h> |
#include <sys/tty.h> |
#include <sys/tty.h> |
|
#include <console.h> |
#include "lcd.h" |
#include "lcd.h" |
#include "kbd_img.h" |
#include "kbd_img.h" |
#include "keymap.h" |
#include "keymap.h" |
|
#include "keypad.h" |
|
|
extern void console_attach(struct tty **tpp); |
|
extern void keypad_attach(void (*handler)(u_char)); |
|
|
|
/* |
/* |
* Since GBA does not kick interrupt for the button release, we have |
* Since GBA does not kick interrupt for the button release, we have |
* to wait for a while after button is pressed. Otherwise, many key |
* to wait for a while after button is pressed. Otherwise, many key |
|
|
#define BUTTON_WAIT 200 /* 200 msec */ |
#define BUTTON_WAIT 200 /* 200 msec */ |
|
|
static int kbd_init(void); |
static int kbd_init(void); |
static int kbd_ioctl(device_t, int, u_long); |
static int kbd_ioctl(device_t, u_long, void *); |
|
|
static void move_cursor(void); |
static void move_cursor(void); |
|
|
|
|
* Just clear ignoring flag. |
* Just clear ignoring flag. |
*/ |
*/ |
static void |
static void |
kbd_timeout(u_long tmp) |
kbd_timeout(void *arg) |
{ |
{ |
|
|
ignore_key = 0; |
ignore_key = 0; |
|
|
kbd_toggle(); |
kbd_toggle(); |
break; |
break; |
case '\n': |
case '\n': |
#ifdef CONFIG_KDUMP |
#ifdef DEBUG |
debug_dump(1); /* Thread dump */ |
debug_dump(DUMP_THREAD); |
debug_dump(2); /* Thread dump */ |
debug_dump(DUMP_TASK); |
debug_dump(7); /* VM dump */ |
debug_dump(DUMP_VM); |
#endif |
#endif |
break; |
break; |
} |
} |
|
|
} |
} |
out: |
out: |
ignore_key = 1; |
ignore_key = 1; |
timer_callout(&kbd_tmr, kbd_timeout, 0, timeout); |
timer_callout(&kbd_tmr, timeout, &kbd_timeout, NULL); |
return; |
return; |
} |
} |
|
|
|
|
* I/O control |
* I/O control |
*/ |
*/ |
static int |
static int |
kbd_ioctl(device_t dev, int cmd, u_long arg) |
kbd_ioctl(device_t dev, u_long cmd, void *arg) |
{ |
{ |
|
|
return 0; |
return 0; |