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 <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-03-31 13:25:30 -04:00
parent 8b48de1be8
commit 72d0c770d3
1 changed files with 2 additions and 0 deletions

View File

@ -56,6 +56,8 @@ irq_wait(void)
static void static void
timer_set(uint32_t value) timer_set(uint32_t value)
{ {
if (!value)
value = 1;
CT_IEP.TMR_CMP0 = value; CT_IEP.TMR_CMP0 = value;
} }