Chapter 5 Detailed Applications
- 71 -
5.1.3 Writing Non-kernel (OS-independent ) Interrupt Handler
When describing the non-kernel(OS-independent) interrupt handler in C language, observe the following pre-
cautions.
1. Be sure to declare the return value and argument of the interrupt handler start function as
a void type.
2. No service call can be issued from a non-kernel(an OS-independent) interrupt handler.
NOTE: If this restriction is not observed, the software may malfunction.
3. A function that is declared to be static cannot be registered as an interrupt handler.
4. If you want multiple interrupts to be enabled in a non-kernel(an OS-independent) interrupt
handler, always make sure that the non-kernel(OS-independent) interrupt handler is as-
signed a priority level higher than other kernel(OS-dependent) interrupt handlers.49
#include <itron.h>
#include <kernel.h>
#include "kernel_id.h"
void inthand(void)
{
/* process */
}
Figure 5.4 Example of Non-kernel(OS-independent) Interrupt Handler
49 If you want the non-kernel(OS-independent) interrupt handler to be assigned a priority level lower than kernel(OS-dependent) interrupt
handlers, change the description of the non-kernel(OS-independent) interrupt handler to that of the kernel (OS-dependent) interrupt handler.