??? 12/15/04 12:45 Read: times |
#83138 - Variations on a theme Responding to: ???'s previous message |
I use a similar method whereby I have a variable I call 'task_bits' that has 1 bit per task. If the bit is set for the task it is primed to run. The main loop waits for a ticker tick then looks for the highest priority task to execute by evaluating 'task_bits'. I also have an array of timers - 1 per task that get decremented by the task tick, when these timers decrement to 0, the task bit is set. Therefore only tasks you want to execute get to execute. Using a structured method makes code writing a lot less error prone be it in asm or 'c' and makes the code easier to maintain and understand. Most co-operative methods are all variations on a theme. It's a matter of choosing the one that suits you. |
Topic | Author | Date |
Making embedded programs | 01/01/70 00:00 | |
State machine... | 01/01/70 00:00 | |
look here | 01/01/70 00:00 | |
Variations on a theme | 01/01/70 00:00 | |
HUH ? | 01/01/70 00:00 | |
Code inside Task ()![]() | 01/01/70 00:00 |