From cb99d648c749fa85f0dc201b85fbdc2650f99125 Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Sat, 10 Dec 2011 00:57:50 -0700 Subject: [PATCH] Don't use % to rotate _task_bitno; too slow. --- task.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/task.c b/task.c index d88d907..bce2b6d 100644 --- a/task.c +++ b/task.c @@ -38,7 +38,8 @@ task_id_t task_get(unsigned char block) for (unsigned char i = 0; t == -1 && i < TASK_COUNT; i++) { if (bit_get(ids, _task_bitno)) t = _task_bitno; - _task_bitno = (_task_bitno + 1) % TASK_COUNT; + if (++_task_bitno == TASK_COUNT) + _task_bitno = 0; } } #if 0 /* Not until we have a crystal and can wake from sleep via tmr module */ -- 2.39.2