summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/fiio/button-fiio.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/fiio/button-fiio.c')
-rw-r--r--firmware/target/hosted/fiio/button-fiio.c10
1 files changed, 10 insertions, 0 deletions
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 {