Chapter 5 Detailed Applications
- 72 -
5.1.4 Writing Cyclic Handler/Alarm Handler
When describing the cyclic or alarm handler in C language, observe the following precautions.
1. Describe the cyclic or alarm handler as a function.50
2. Be sure to declare the return value and argument of the interrupt handler start function as
a void type.
3. At the beginning of file, be sure to include "itron.h",”kernel.h” which is in the system di-
rectory as well as "kernel_id.h" which is in the current directory.
4. The static declared functions cannot be registered as a cyclic handler or alarm handler.
5. The cyclic handler and alarm handler are invoked by a subroutine call from a system clock
interrupt handler.
#include <itron.h>
#include <kernel.h>
#include "kernel_id.h"
void cychand(void)
{
/*process */
}
Figure 5.5 Example Cyclic Handler Written in C Language
50 The handler-to-function name correlation is determined by the configuration file.