From: R. Steve McKown Date: Sat, 10 Dec 2011 07:57:50 +0000 (-0700) Subject: Don't use % to rotate _task_bitno; too slow. X-Git-Tag: 1.0~24 X-Git-Url: https://oss.titaniummirror.com/gitweb?p=rgblamp.git;a=commitdiff_plain;h=cb99d648c749fa85f0dc201b85fbdc2650f99125 Don't use % to rotate _task_bitno; too slow. --- 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 */