summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/export/config/fiiom3klinux.h3
-rw-r--r--firmware/target/hosted/fiio/button-fiio.c10
-rw-r--r--firmware/target/hosted/fiio/button-target.h6
3 files changed, 19 insertions, 0 deletions
diff --git a/firmware/export/config/fiiom3klinux.h b/firmware/export/config/fiiom3klinux.h
index 0ce58be46f..c383242909 100644
--- a/firmware/export/config/fiiom3klinux.h
+++ b/firmware/export/config/fiiom3klinux.h
@@ -51,6 +51,9 @@
51#define HAVE_BUTTON_LIGHT 51#define HAVE_BUTTON_LIGHT
52#define HAVE_BUTTONLIGHT_BRIGHTNESS 52#define HAVE_BUTTONLIGHT_BRIGHTNESS
53 53
54/* We have a touchpad */
55#define HAVE_TOUCHPAD
56
54/* Main LCD backlight brightness range and defaults: the backlight driver 57/* Main LCD backlight brightness range and defaults: the backlight driver
55 * has levels from 0 to 32. But 0 is off so start at 1. 58 * has levels from 0 to 32. But 0 is off so start at 1.
56 */ 59 */
diff --git a/firmware/target/hosted/fiio/button-fiio.c b/firmware/target/hosted/fiio/button-fiio.c
index 4acbfb0ea7..ffd2fbc454 100644
--- a/firmware/target/hosted/fiio/button-fiio.c
+++ b/firmware/target/hosted/fiio/button-fiio.c
@@ -46,6 +46,8 @@ static int key_up_delay = 0;
46static int key_down_delay = 0; 46static int key_down_delay = 0;
47static int key_f12_delay = 0; 47static int key_f12_delay = 0;
48 48
49static int tp_enabled = 1;
50
49#define NR_POLL_DESC 2 51#define NR_POLL_DESC 2
50static struct pollfd poll_fds[NR_POLL_DESC]; 52static struct pollfd poll_fds[NR_POLL_DESC];
51 53
@@ -236,6 +238,11 @@ void button_init_device(void)
236 } 238 }
237} 239}
238 240
241void touchpad_enable_device(bool en)
242{
243 tp_enabled = en;
244}
245
239int button_read_device(void) 246int button_read_device(void)
240{ 247{
241 static int button_bitmap = 0; 248 static int button_bitmap = 0;
@@ -247,6 +254,9 @@ int button_read_device(void)
247 { 254 {
248 for(int i = 0; i < NR_POLL_DESC; i++) 255 for(int i = 0; i < NR_POLL_DESC; i++)
249 { 256 {
257 if (i == 1 && !tp_enabled) /* Ignore touchpad ? */
258 continue;
259
250 /* read only if non-blocking */ 260 /* read only if non-blocking */
251 if(poll_fds[i].revents & POLLIN) 261 if(poll_fds[i].revents & POLLIN)
252 { 262 {
diff --git a/firmware/target/hosted/fiio/button-target.h b/firmware/target/hosted/fiio/button-target.h
index 7098eaf9f3..92298960f8 100644
--- a/firmware/target/hosted/fiio/button-target.h
+++ b/firmware/target/hosted/fiio/button-target.h
@@ -39,8 +39,14 @@
39#define BUTTON_LEFT BUTTON_PREV 39#define BUTTON_LEFT BUTTON_PREV
40#define BUTTON_RIGHT BUTTON_NEXT 40#define BUTTON_RIGHT BUTTON_NEXT
41 41
42#define BUTTON_TOUCHPAD (BUTTON_UP|BUTTON_DOWN|BUTTON_PREV|BUTTON_NEXT|\
43 BUTTON_HOME|BUTTON_OPTION)
44
42/* Software power-off */ 45/* Software power-off */
43#define POWEROFF_BUTTON BUTTON_POWER 46#define POWEROFF_BUTTON BUTTON_POWER
44#define POWEROFF_COUNT 25 47#define POWEROFF_COUNT 25
45 48
49void touchpad_enable_device(bool en);
50
51
46#endif /* _BUTTON_TARGET_H_ */ 52#endif /* _BUTTON_TARGET_H_ */