??? 07/09/10 11:00 Read: times |
#177173 - re - Separate display processor Responding to: ???'s previous message |
Andy Neil said: The timer interrupt is asynchronous with anything else. How can one be certain that tasks are done before the interrupt fires unless tasks are shorter than the timer period?
the idea of a co-operative system needs all tasks to complete before the scheduler runs again. This inevitably wastes processing time.
Does it? If so, processor time is wasted. I have been using a sparetime routine that runs at the end of the despatcher. This works well for eg., RS232.
It only needs to check that the remaining time is sufficient to send a character. This speeded up the comms tremendously. Are you using polled comms, then? No, this was done for the transmit part of the RS232. There is precious little time to send strings in between other tasks. Some tasks only poll a hardware input, so leave plenty of spare time that can be used. Are we talking Coroutines here?
No, I do not think so. The suggestion is for a background routine that will only be interrupted by the timer interrupt. Then it is returned to when the despatcher is done. Coroutines are more complicated, I think. Regards Johan Smit |