
20 Chapter 1 Embedded Computing
program includes one set of functions known as events. The program may also
include functions called commands to help implement the program, but another
component uses the events to call the program. A set of components can be
assembled into a system using interface connections known as wiring.
TinyOS executes only one program using two threads: one containing tasks
and another containing hardware event handlers. The tasks are scheduled by
TinyOS; tasks are run to completion and do not preempt each other. Hardware
event handlers are initiated by hardware interrupts. They may preempt tasks or
other handlers and run to ...