summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tcc780x/cowond2/button-cowond2.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/tcc780x/cowond2/button-cowond2.c')
-rw-r--r--firmware/target/arm/tcc780x/cowond2/button-cowond2.c8
1 files changed, 5 insertions, 3 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)
27 /* Nothing to do */ 27 /* Nothing to do */
28} 28}
29 29
30bool button_hold(void)
31{
32 return (GPIOA & 0x8) ? false : true;
33}
34
30int button_read_device(void) 35int button_read_device(void)
31{ 36{
32 int btn = BUTTON_NONE; 37 int btn = BUTTON_NONE;
@@ -57,9 +62,6 @@ int button_read_device(void)
57 /* TODO: Read 'fake' buttons based on touchscreen quadrants. 62 /* TODO: Read 'fake' buttons based on touchscreen quadrants.
58 Question: How can I read from the PCF chip (I2C) in a tick task? */ 63 Question: How can I read from the PCF chip (I2C) in a tick task? */
59 64
60 if (!(GPIOA & 0x8))
61 btn |= BUTTON_HOLD;
62
63 if (!(GPIOA & 0x4)) 65 if (!(GPIOA & 0x4))
64 btn |= BUTTON_POWER; 66 btn |= BUTTON_POWER;
65 67