MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Uživatelská příručka Strana 293

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 386
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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:
Zobrazit stránku 292
1 2 ... 288 289 290 291 292 293 294 295 296 297 298 ... 385 386

Komentáře k této Příručce

Žádné komentáře