MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Guide de l'utilisateur Page 293

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 386
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 292
Interrupt Handling
11-15
Asynchronous Interrupt Block Example - RTW Mode
This example shows the Asynchronous Interrupt block in RTW mode:
Note that the simulated plant signals that were included in the previous
example have been omitted. In RTW mode, the Asynchronous Interrupt block
receives interrupts directly from the hardware.
During the Target Language Compiler (TLC) phase of code generation, the
Asynchronous Interrupt block installs the code in the Stateflow Chart and the
Subsystem block as interrupt service routines. Configuring a function-call
subsystem as an ISR requires two function calls,
int_connect and int_enable.
For example, the function
f(u) in the Function block requires this procedure:
In the
mdlStart function, the Asynchronous Interrupt block inserts a call to
int_connect and sysIntEnable:
/* model start function */
MdlStart()
{
. . .
int_connect(f,192,1);
. . .
sysIntEnable(1);
. . .
}
* Plant is removed
Offset
192
Int Vector table
&f()
Stand-alone functions are
installed as ISR’s:
Vue de la page 292
1 2 ... 288 289 290 291 292 293 294 295 296 297 298 ... 385 386

Commentaires sur ces manuels

Pas de commentaire