summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/fiio
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/fiio')
-rw-r--r--firmware/target/hosted/fiio/button-fiio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/target/hosted/fiio/button-fiio.c b/firmware/target/hosted/fiio/button-fiio.c
index 79ed702668..134ec5a426 100644
--- a/firmware/target/hosted/fiio/button-fiio.c
+++ b/firmware/target/hosted/fiio/button-fiio.c
@@ -85,7 +85,7 @@ static int button_map_on(int keycode)
85 case KEY_F8: 85 case KEY_F8:
86 key_power_delay = 0; 86 key_power_delay = 0;
87 return BUTTON_POWER; 87 return BUTTON_POWER;
88 88
89 case KEY_HOME: 89 case KEY_HOME:
90 key_home_delay = DEF_DELAY; 90 key_home_delay = DEF_DELAY;
91 return BUTTON_OPTION; 91 return BUTTON_OPTION;
@@ -147,7 +147,7 @@ static int button_map_off(int keycode)
147 147
148 case KEY_F8: 148 case KEY_F8:
149 return BUTTON_POWER; 149 return BUTTON_POWER;
150 150
151 case KEY_F9: 151 case KEY_F9:
152 return BUTTON_OPTION; 152 return BUTTON_OPTION;
153 153
@@ -168,7 +168,7 @@ static int button_map_off(int keycode)
168static int button_map_timer(void) 168static int button_map_timer(void)
169{ 169{
170 int map = 0; 170 int map = 0;
171 171
172 if (key_enter_delay) 172 if (key_enter_delay)
173 { 173 {
174 if (--key_enter_delay == 0) map |= BUTTON_PLAY; 174 if (--key_enter_delay == 0) map |= BUTTON_PLAY;
@@ -219,14 +219,14 @@ static int button_map_timer(void)
219 219
220void button_init_device(void) 220void button_init_device(void)
221{ 221{
222 const char * const input_devs[] = { 222 const char * const input_devs[NR_POLL_DESC] = {
223 "/dev/input/event0", 223 "/dev/input/event0",
224 "/dev/input/event1", 224 "/dev/input/event1",
225 }; 225 };
226 226
227 for(int i = 0; i < NR_POLL_DESC; i++) 227 for(int i = 0; i < NR_POLL_DESC; i++)
228 { 228 {
229 int fd = open(input_devs[i], O_RDWR | O_CLOEXEC); 229 int fd = open(input_devs[i], O_RDONLY | O_CLOEXEC);
230 230
231 if(fd < 0) 231 if(fd < 0)
232 { 232 {