summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/tcc780x/cowond2/button-cowond2.c8
-rw-r--r--firmware/target/arm/tcc780x/cowond2/button-target.h10
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