Download Efficient Time-Triggered Execution in an Interrupt-Driven Real
Transcript
Dispatcher Table (length = 200) 0 Cell 1 compare value counter 200 Act. Task1 Act. Task2 offset=60 offset=170 50 100 150 t 200 E IRQ Task1 E IRQ Task1 initial counter 100 t 0 0 Cell 2 compare value 50 100 150 counter 200 250 300 350 E IRQ Task2 200 400 E IRQ Task2 100 initial counter t 0 0 50 100 150 1st dispatcher round 200 250 300 350 400 2nd dispatcher round Figure 4.1: Example of the timer cell configurations for a dispatcher table with two time-triggered activations. The initial counter values define the delay of the first interrupt request, which then is followed by repeated requests corresponding to the compare value. activations, which are aligned on the time axis according to the particular offset of each activation in the dispatcher table. In order to obtain an execution pattern in which each activation inevitably leads to dispatching the task, the interrupt priority assigned to the handlers of timetriggered activations needs to be set to a level that is guaranteed to be higher than the current execution priority of an already running task. This is done by lowering the CPU priority to a suitable level within the task prologue prior to entering the user code. Due to the run-to-completion semantics of interrupt handlers, this implicitly yields the desired last-in-first-out execution pattern whenever planned activations collide with previously running tasks. 13