X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=task.c;h=bce2b6dbaf30e59a4b3bb7ab25dfe75a3c02ede3;hb=cb99d648c749fa85f0dc201b85fbdc2650f99125;hp=d88d9076fe1e568deeeb180a31de7f682cb62a7e;hpb=b2527c29d63421702a2a2b132f174074cd950e31;p=rgblamp.git 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 */