mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-11-23 03:39:41 +02:00
qi-gta01-add-ui-debounce.patch
Signed-off-by: Andy Green <andy@openmoko.com>
This commit is contained in:
parent
bede2a1359
commit
f23a39d80d
@ -209,6 +209,32 @@ static void close_gta01(void)
|
||||
(bb_s3c24xx.close)();
|
||||
}
|
||||
|
||||
static u8 get_ui_keys_gta02(void)
|
||||
{
|
||||
u8 keys;
|
||||
u8 ret;
|
||||
static u8 old_keys = 0; /* previous state for debounce */
|
||||
static u8 old_ret = 0; /* previous debounced output for edge detect */
|
||||
|
||||
/* GPF6 is AUX on GTA01, map to UI_ACTION_ADD_DEBUG, down = 1 */
|
||||
keys = ! (rGPFDAT & (1 << 6));
|
||||
|
||||
if (keys == old_keys)
|
||||
ret = keys;
|
||||
else
|
||||
ret = old_keys;
|
||||
|
||||
/* edge action */
|
||||
if ((ret & 1) && !(old_ret & 1))
|
||||
ret |= UI_ACTION_SKIPKERNEL;
|
||||
|
||||
old_keys = keys;
|
||||
old_ret = ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* API for bootloader on this machine
|
||||
*/
|
||||
@ -224,6 +250,8 @@ const struct board_api board_api_gta01 = {
|
||||
.port_init = port_init_gta01,
|
||||
.putc = putc_gta01,
|
||||
.close = close_gta01,
|
||||
.get_ui_keys = get_ui_keys_gta02,
|
||||
|
||||
.commandline_board = "mtdparts=" \
|
||||
"neo1973-nand:" \
|
||||
"0x00040000(qi)," \
|
||||
|
Loading…
Reference in New Issue
Block a user