From eafc7012daedfb5a38ef4db4a9bc76d12992323b Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 12 Jan 2014 21:29:55 +0100 Subject: [PATCH] scroll_engine: Fix FS#12894: Text scrolling stops working after a few seconds/minutes Since commit 706b920 a timeout of TIMEOUT_BLOCK (-1) will cause queue_event_w_tmo() block indefinitely (previously it behaved as TIMEOUT_NOBLOCK). scroll_process_message() can be called with negative timeouts, with luck also -1. To fix this convert all negative timeouts to TIMEOUT_NOBLOCK explicitely. Change-Id: I1fc20d93acbba50d713c8364f635365930b38cbf --- firmware/scroll_engine.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/scroll_engine.c b/firmware/scroll_engine.c index d1bc2976a1..cb0051dac7 100644 --- a/firmware/scroll_engine.c +++ b/firmware/scroll_engine.c @@ -79,6 +79,10 @@ static bool scroll_process_message(int delay) { struct queue_event ev; + /* just poll once for negative delays */ + if (delay < 0) + delay = TIMEOUT_NOBLOCK; + do { long tick = current_tick; @@ -199,4 +203,3 @@ void scroll_init(void) IF_PRIO(, PRIORITY_USER_INTERFACE) IF_COP(, CPU)); } -