Event-triggered systems
Many applications are now described as ‘event triggered’ or ‘event driven’. For example, in the case of modern desktop applications, the various running applications must respond to events such as mouse clicks or mouse movements. A key expectation of users is that such events will invoke an ‘immediate’ response.
In embedded systems, event-triggered behaviour is often achieved through the use of interrupts (see following box). To support these, event-triggered system architectures often provide multiple interrupt service routines.
In Figure 1.5 the system executes two (background) tasks, Task 1 and Task 2. During the execution of Task 1, an interrupt is raised, and an ‘interrupt service routine’ (ISR1) deals with this event. During the execution of Task 2, another interrupt is raised, this time dealt with by ISR2.
Note that, from the perspective of the programmer, an ISR is simply a function that is ‘called by the microcontroller’, as a result of a particular hardware event.