summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-06-07 22:16:40 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-06-07 22:28:58 +0100
commit55c95a9cf53f78490926be9ae6643fb2e61f9572 (patch)
tree1e51c86724edb49bdcec52a5963c8bffb23d742a /firmware/target/mips
parent4c94c1791378aeccc419354dd3fc5eb7776793cb (diff)
downloadrockbox-55c95a9cf53f78490926be9ae6643fb2e61f9572.tar.gz
rockbox-55c95a9cf53f78490926be9ae6643fb2e61f9572.zip
FiiO M3K: filter touchpad input when it's disabled
I had hoped this would fix FS#13297, but no luck. Might as well do this change anyway, because it's the "right" thing to do. Change-Id: I55819c881d2141dd565e1c1f21460578c9114ff6
Diffstat (limited to 'firmware/target/mips')
-rw-r--r--firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c b/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c
index d566ccb6c8..4a853cd88f 100644
--- a/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c
+++ b/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c
@@ -301,17 +301,21 @@ static void ft_step_state(uint32_t t, int evt, int tx, int ty)
int dy = fsm.cur_y - fsm.orig_y;
int dp = (dx*dx) + (dy*dy);
if(dp >= ftd.scroll_thresh_sqr) {
- if(dy < 0) {
- queue_post(&button_queue, BUTTON_SCROLL_BACK, 0);
- } else {
- queue_post(&button_queue, BUTTON_SCROLL_FWD, 0);
+ /* avoid generating events if we're supposed to be inactive...
+ * should not be necessary but better to be safe. */
+ if(ftd.active) {
+ if(dy < 0) {
+ queue_post(&button_queue, BUTTON_SCROLL_BACK, 0);
+ } else {
+ queue_post(&button_queue, BUTTON_SCROLL_FWD, 0);
+ }
+
+ /* Poke the backlight */
+ backlight_on();
+ buttonlight_on();
+ reset_poweroff_timer();
}
- /* Poke the backlight */
- backlight_on();
- buttonlight_on();
- reset_poweroff_timer();
-
fsm.orig_x = fsm.cur_x;
fsm.orig_y = fsm.cur_y;
}
@@ -475,7 +479,7 @@ int button_read_device(void)
if((b & (1 << 28)) == 0) r |= BUTTON_VOL_DOWN;
if((b & (1 << 31)) == 0) r |= BUTTON_POWER;
- return r;
+ return touchpad_filter(r);
}
bool headphones_inserted(void)