diff options
author | Rob Purchase <shotofadds@rockbox.org> | 2008-03-22 15:55:19 +0000 |
---|---|---|
committer | Rob Purchase <shotofadds@rockbox.org> | 2008-03-22 15:55:19 +0000 |
commit | f061ba4ebbfcefb4613ea726104c1b3f9f1a528d (patch) | |
tree | eeba708f08b94eb616cbd565d46efc36e7960d8e | |
parent | b659c0c14cbe89cd7602a847e90058e4f39b7fc3 (diff) |
D2: Implement HAS_BUTTON_HOLD.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16748 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/tcc780x/cowond2/button-cowond2.c | 8 | ||||
-rw-r--r-- | firmware/target/arm/tcc780x/cowond2/button-target.h | 10 |
2 files changed, 11 insertions, 7 deletions
diff --git a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c index 69ec532609..12fafe6c8c 100644 --- a/firmware/target/arm/tcc780x/cowond2/button-cowond2.c +++ b/firmware/target/arm/tcc780x/cowond2/button-cowond2.c @@ -27,6 +27,11 @@ void button_init_device(void) /* Nothing to do */ } +bool button_hold(void) +{ + return (GPIOA & 0x8) ? false : true; +} + int button_read_device(void) { int btn = BUTTON_NONE; @@ -57,9 +62,6 @@ int button_read_device(void) /* TODO: Read 'fake' buttons based on touchscreen quadrants. Question: How can I read from the PCF chip (I2C) in a tick task? */ - if (!(GPIOA & 0x8)) - btn |= BUTTON_HOLD; - if (!(GPIOA & 0x4)) btn |= BUTTON_POWER; diff --git a/firmware/target/arm/tcc780x/cowond2/button-target.h b/firmware/target/arm/tcc780x/cowond2/button-target.h index aa336f2f1f..1ce602a30d 100644 --- a/firmware/target/arm/tcc780x/cowond2/button-target.h +++ b/firmware/target/arm/tcc780x/cowond2/button-target.h @@ -23,15 +23,17 @@ #include <stdbool.h> #include "config.h" +#define HAS_BUTTON_HOLD + +bool button_hold(void); void button_init_device(void); int button_read_device(void); /* Main unit's buttons */ #define BUTTON_POWER 0x00000001 -#define BUTTON_HOLD 0x00000002 -#define BUTTON_PLUS 0x00000004 -#define BUTTON_MINUS 0x00000008 -#define BUTTON_MENU 0x00000010 +#define BUTTON_PLUS 0x00000002 +#define BUTTON_MINUS 0x00000004 +#define BUTTON_MENU 0x00000008 /* Faked buttons based on touchscreen quadrants (not yet read) */ #define BUTTON_UP 0x00000020 |