From 72d0c770d375b5bb728d41c01522c9865becd9f0 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 31 Mar 2019 13:25:30 -0400 Subject: [PATCH] pru: Avoid using a timer wake time of exactly zero It appears the PRU timer will not trigger on a match of exactly zero. If the next timer happened to be set to exactly zero, it could cause software timers to get stuck and result in "move queue empty" errors. Signed-off-by: Kevin O'Connor --- src/pru/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pru/main.c b/src/pru/main.c index 88e622a6..e91477e1 100644 --- a/src/pru/main.c +++ b/src/pru/main.c @@ -56,6 +56,8 @@ irq_wait(void) static void timer_set(uint32_t value) { + if (!value) + value = 1; CT_IEP.TMR_CMP0 = value; }