In SX Microcontrollers, SX/B Compiler and SX-Key Tool, peterverkaik wrote: Bean, To support running tasks scheduled for the same tick, in one tick you can change if taskDelay(0) = 0 then on taskId(0) gosub Task0,Task1,Task2,Task3,Task4,Task5,Task6,Task7 taskDelay(0) = taskInterval(0) Reschedule endif into do while taskDelay(0) = 0 on taskId(0) gosub Task0,Task1,Task2,Task3,Task4,Task5,Task6,Task7 taskDelay(0) = taskInterval(0) Reschedule loop in subroutine DoSchedule We then need to set a pending bit for TASKTICK, in case a task is already running the moment a context switch should take place. regards peter ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=2&m=157842#m176165 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)