USBB17RX78K4-XXX NEC Electronics, USBB17RX78K4-XXX Datasheet - Page 25

no-image

USBB17RX78K4-XXX

Manufacturer Part Number
USBB17RX78K4-XXX
Description
78K/4 series realtime OS
Manufacturer
NEC Electronics
Datasheet
2.4 Interrupt Management
routine that is vectored by an interrupt is called an interrupt handler, which is independent of tasks. There are
functions to set or exit execution from the interrupt handler.
issue “ret_int” from an interrupt handler occupying the register bank, select the register bank of the task executed
before the interrupt has occurred, and then call “ret_int”.
interrupt handler. If a task in the WAIT state is waken up an interrupt handler, system calls “ret_int” and “ret_wup”
return control to the state of a task under execution when the interrupt has occurred, if the priority of the task to be
waken up is lower than the priority of the task under execution when the interrupt has occurred.
to be waken up. Fig. 2-2 illustrates flow of control if task A has a higher priority than task B.
16
Interrupt management is for managing processing that is driven taking an interrupt as an event. A processing
To terminate the interrupt handler and pass control to a task, system calls “ret_int” and “ret_wup” are used. To
Because RX78K/IV does not initialize each interrupt source, each source must be initialized by the user task.
Fig. 2-2 and 2-3 illustrate the flow of control when a task in the WAIT state is waken up by an event flag in an
If the task to be waken up has a higher priority than that of the task under execution, control is passed to the task
Caution
<1> Task B has issued system call “wai_tsk” and is now in the WAIT state.
<2> Task A is under execution (has the highest priority of the tasks in the READY state).
<3> An interrupt occurs while task A is executed, and processing is passed to the interrupt handler.
<4> System call “iset_flg” is issued in the interrupt handler and task B is waken up.
<5> System call “ret_int” is issued in the interrupt handler.
<6> Because task A has a priority higher than that of task B, processing is returned to task A.
System calls cannot be issued during NMI interrupt processing.
Please note that RX78K/IV does not support multiple interrupt among the interrupt handlers
which are set for interrupt priority 3 (lowest level). Neither does it support them with the timer
processing.
Interrupt
Task A (PR1=2)
<2>
<6>
<3>
CHAPTER 2
Fig. 2-2 Example of “ret_int”
BASIC FUNCTIONS OF RX78K/IV
<4>
Interrupt handler
<5>
(Wakes up task B)
iset_flg
ret_int
Task B (PRI=3)
<1> wai_flg

Related parts for USBB17RX78K4-XXX