]> oss.titaniummirror.com Git - rgblamp.git/commitdiff
Don't use % to rotate _task_bitno; too slow.
authorR. Steve McKown <rsmckown@gmail.com>
Sat, 10 Dec 2011 07:57:50 +0000 (00:57 -0700)
committerR. Steve McKown <rsmckown@gmail.com>
Sat, 10 Dec 2011 07:57:50 +0000 (00:57 -0700)
task.c

diff --git a/task.c b/task.c
index d88d9076fe1e568deeeb180a31de7f682cb62a7e..bce2b6dbaf30e59a4b3bb7ab25dfe75a3c02ede3 100644 (file)
--- 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 */