From 06601e5fbaa772bdfe4265c19ff75c3f8c24e223 Mon Sep 17 00:00:00 2001 From: Szymon Dziok Date: Mon, 24 May 2010 19:48:06 +0000 Subject: Vibe 500: fix the scrolling through the lists by implementing BUTTON_REPEAT for the scrollstrip. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26268 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/pbell/vibe500/button-vibe500.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'firmware') diff --git a/firmware/target/arm/pbell/vibe500/button-vibe500.c b/firmware/target/arm/pbell/vibe500/button-vibe500.c index b129cfea2d..54b4d2dbb1 100644 --- a/firmware/target/arm/pbell/vibe500/button-vibe500.c +++ b/firmware/target/arm/pbell/vibe500/button-vibe500.c @@ -29,6 +29,9 @@ static int int_btn = BUTTON_NONE; static int old_pos = -1; +static int scroll_repeat = BUTTON_NONE; +static int repeat = 0; + void button_init_device(void) { } @@ -68,9 +71,23 @@ void button_int(void) int scr_pos = val >> 8; /* split the scrollstrip into 16 regions */ if ((old_posscr_pos)&&(old_pos!=-1)) int_btn = BUTTON_UP; + old_pos = scr_pos; + + /* repeat button */ + repeat = 0; + if (int_btn!=BUTTON_NONE) + { + if (int_btn!=scroll_repeat) + scroll_repeat = int_btn; + else repeat = BUTTON_REPEAT; + } + } + else + { + old_pos = -1; + scroll_repeat = BUTTON_NONE; } - else old_pos=-1; } } @@ -106,12 +123,13 @@ int button_read_device(void) /* Scrollstrip direct button post - much better response */ if ((buttons==BUTTON_UP) || (buttons==BUTTON_DOWN)) { - queue_post(&button_queue,buttons,0); + queue_post(&button_queue,buttons|repeat,0); backlight_on(); buttonlight_on(); reset_poweroff_timer(); buttons = BUTTON_NONE; int_btn = BUTTON_NONE; + repeat = BUTTON_NONE; } } else return BUTTON_NONE; -- cgit v1.2.3