CompuLab SBC-X270 Manual do Utilizador Página 46

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 226
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 45
SCIOPTA - Real-Time Kernel
5-6 Manual Version 4.1 User’s Manual
SCIOPTA - Real-Time Kernel
5 Processes
5.7.3.2 Interrupt Source Parameter
The interrupt process declaration has beside the process name a second parameter (<irq_src> see chapter 5.7.3.1
Interrupt Process Declaration Syntax” on page 5-5) which defines the interrupt source. This parameter is set by
the kernel depending on the interrupt source.
Interrupt Source Parameter Values
0 The interrupt process is activated by a real hardware interrupt.
1 The interrupt process is activated by a message sent to the interrupt process.
2 The interrupt process is activated by a trigger event.
-1 The interrupt process is activated when the process is created. This allows the interrupt process to execute some
initialization code.
-2 The interrupt process is activated when the process is killed. This allows the interrupt process to execute some
exit code.
5.7.3.3 Interrupt Process Template
In this chapter a template for an interrupt process in SCIOPTA is provided.
#include <sciopta.h> /* SCIOPTA standard prototypes and definitions */
SC_INT_PROCESS (proc_name, irq_src)/* Declaration for interrupt process proc_name */
{
/* Local variables */
if (irq_src == 0) /* Generated by hardware */
{
/* Code for hardware interrupt handling */
}
else if (irq_src == -1) /* Generated when process created */
{
/* Initialization code */
}
else if (irq_src == -2) /* Generated when process killed */
{
/* Exit code */
}
else if (irq_src == 1) /* Generated by a message sent to this interrupt process */
{
/* Code for receiving a message */
}
else if (irq_src == 2) /* Generated by a SCIOPTA trigger event */
{
/* Code for trigger event handling */
}
}
Vista de página 45
1 2 ... 41 42 43 44 45 46 47 48 49 50 51 ... 225 226

Comentários a estes Manuais

Sem comentários