MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Podręcznik Użytkownika Strona 294

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 386
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 293
11 Real-Time Workshop Libraries
11-16
Locking and Unlocking ISRs. It is possible to lock ISRs so that they are not
preempted by a higher priority interrupt. Configuring the interrupt as
nonpreemptive has this effect. This code shows where the Real-Time Workshop
places the
int_lock and int_unlock functions to configure the interrupt as
nonpreemptive:
Finally, the model’s terminate function disables the interrupt:
/* model terminate function */
MdlTerminate()
{
...
int_disable(1);
...
}
Task Synchronization Block
The VxWorks Task Synchronization block is a function-call subsystem that
spawns, as an independent VxWorks task, the function-call subsystem
connected to its output. It is meant to be placed between two other function-call
subsytems. Typically it would be placed between the VxWorks Asynchronous
Interrupt block and a function-call subsystem block or a Stateflow chart.
Another example would be to place the Task Synchronization block at the
output of a Stateflow diagram that has an Event “Output to Simulink”
configured as a function-call. The VxWorks Task Synchronization block
performs the following functions:
The downstream function-call subsystem is spawned as an independent task
using the VxWorks system call
taskSpawn(). The task is deleted using
taskDelete() during model termination.
Real-Time Workshop code
f()
{
lock = int_lock();
. . .
. . .
. . .
int_unlock(lock);
}
Przeglądanie stron 293
1 2 ... 289 290 291 292 293 294 295 296 297 298 299 ... 385 386

Komentarze do niniejszej Instrukcji

Brak uwag