
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 */
}
}
Kommentare zu diesen Handbüchern