From 55c95a9cf53f78490926be9ae6643fb2e61f9572 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Mon, 7 Jun 2021 22:16:40 +0100 Subject: 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 --- .../mips/ingenic_x1000/fiiom3k/button-fiiom3k.c | 24 +++++++++++++--------- 1 file 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) -- cgit v1.2.3