MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Guía de usuario Pagina 293

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 386
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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:
Vista de pagina 292
1 2 ... 288 289 290 291 292 293 294 295 296 297 298 ... 385 386

Comentarios a estos manuales

Sin comentarios