Professional Documents
Culture Documents
Basic Design Using RTOS
Basic Design Using RTOS
Write short interrupt routines, but not too short large number of tasks - pros: - better control of the priorities and by this of the relative response times, better modularity - cleaner code, more effective encapsulation of data large number of tasks - cons: more data sharing, more semaphores, more time on handling them and more bugs, more time on message passing between tasks
Design
Resolving a timing problem Deciding to use an RTOS Dividing the work into Tasks
Design
Moving the System Forward - interrupts are sending signals through the system , telling tasks to do their work Dealing with the shared data - the gasoline levels data is shared by several tasks : - should we protect that data with a semaphore or should we create a separate task responsible for keeping the data consistent? - 1st question - how long any one task will hold on to the semaphore - not very long - 1or 2 msec. - 2nd question - can every task wait that long - Yes. So we do not need a separate task