Niels,
Ahh..thank you! Just what I needed!
So basicly:
Or something like that...Code:Main: If ISRLoop // 10 = 0 then Gosub 10HzTask EndIf If ISRLoop // 50 = 0 then Gosub 2HzTask EndIf If ISRLoop // 2 = 0 then Gosub 50HzTask EndIf If (ISRLoop + 1) // 2 = 0 then Gosub Other50HzTask Endif Goto Main
If I got that right it will work. I'll have to make sure that the tasks that may be run at any given time doesn't take longer than a total of 10mS because then ISRLoop will have been incremented before the 'scheduler' can check if the task should run. Need to do some carefull timing and planning here! And perhaps 'spread' the tasks out like with the 'Other50HzTask' above.
Thanks!
/Henrik Olsson.




Bookmarks