diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-01-06 23:41:36 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-01-06 23:41:36 +0000 |
commit | 57667c51cf09de052222484ce94fbd6da113a55c (patch) | |
tree | b85872be9b6c204e7d66a9203a64d78c524a38a5 /firmware/target/arm/as3525/sansa-c200v2/button-c200v2.c | |
parent | 8e8e2627b27b28a855881db09f2c16bfb2193050 (diff) | |
download | rockbox-57667c51cf09de052222484ce94fbd6da113a55c.tar.gz rockbox-57667c51cf09de052222484ce94fbd6da113a55c.zip |
Sansa AMS: refactor DBOP button reading (e200v2/Fuze/c200v2)
This gets rid of LCD glitches on Sansa Fuze, and now LCD transfers can
get interrupted by button reading
Flyspray: FS #10603
Author: Bertrik Sikken
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24192 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sansa-c200v2/button-c200v2.c')
-rw-r--r-- | firmware/target/arm/as3525/sansa-c200v2/button-c200v2.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/firmware/target/arm/as3525/sansa-c200v2/button-c200v2.c b/firmware/target/arm/as3525/sansa-c200v2/button-c200v2.c index b7ce7330c0..8a95c2d661 100644 --- a/firmware/target/arm/as3525/sansa-c200v2/button-c200v2.c +++ b/firmware/target/arm/as3525/sansa-c200v2/button-c200v2.c | |||
@@ -5,9 +5,9 @@ | |||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id: button-e200v2.c 19035 2008-11-07 05:31:05Z jdgordon $ | 8 | * $Id: button-c200v2.c 19035 2008-11-07 05:31:05Z jdgordon $ |
9 | * | 9 | * |
10 | * Copyright (C) 2006 by Barry Wardell | 10 | * Copyright (C) 2006 by Barry Wardell, (C) 2009 by Bertrik Sikken |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or | 12 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 13 | * modify it under the terms of the GNU General Public License |
@@ -19,29 +19,20 @@ | |||
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | 21 | ||
22 | #include "config.h" | ||
22 | #include "system.h" | 23 | #include "system.h" |
23 | #include "button-target.h" | 24 | #include "button-target.h" |
24 | #include "button.h" | 25 | #include "button.h" |
25 | #include "backlight.h" | 26 | #include "backlight.h" |
26 | #include "powermgmt.h" | 27 | #include "dbop-as3525.h" |
27 | 28 | ||
28 | 29 | static unsigned short _dbop_din; | |
29 | static unsigned short _dbop_din = 0xFFFF; | ||
30 | |||
31 | /* in the lcd driver */ | ||
32 | extern unsigned short int lcd_dbop_input(void); | ||
33 | 30 | ||
34 | static bool hold_button = false; | 31 | static bool hold_button = false; |
35 | #ifndef BOOTLOADER | 32 | #ifndef BOOTLOADER |
36 | static bool hold_button_old = false; | 33 | static bool hold_button_old = false; |
37 | #endif | 34 | #endif |
38 | 35 | ||
39 | /* for the debug menu */ | ||
40 | unsigned short button_dbop_data(void) | ||
41 | { | ||
42 | return _dbop_din; | ||
43 | } | ||
44 | |||
45 | void button_init_device(void) | 36 | void button_init_device(void) |
46 | { | 37 | { |
47 | GPIOA_DIR &= ~(1<<3); | 38 | GPIOA_DIR &= ~(1<<3); |
@@ -59,7 +50,7 @@ int button_read_device(void) | |||
59 | { | 50 | { |
60 | int btn = BUTTON_NONE; | 51 | int btn = BUTTON_NONE; |
61 | 52 | ||
62 | _dbop_din = lcd_dbop_input(); | 53 | _dbop_din = dbop_read_input(); |
63 | 54 | ||
64 | /* hold button handling */ | 55 | /* hold button handling */ |
65 | hold_button = ((_dbop_din & (1<<12)) == 0); | 56 | hold_button = ((_dbop_din & (1<<12)) == 0); |