
B–61863E–1/06
2. TASK CONTROL FUNCTION
PMC CONTROL SOFTWARE
75
(3) Writing data to a mailbox
To write a message to the mailbox, use the system call, os_write_mbx
or os_wrt2_mbx. os_write_mbx writes data in the low-order 4 bytes
of a message area and sets 0s in the high-order 4 bytes. os_wrt2_mbx
writes data in an entire 8-byte message area.
0000’2222’
’11112222’
Mail box
os_write_mbx
os_wrt2_mbx
’1111’,’2222’
’2222’
“Example of intertask communication with a mailbox”
Suppose that a task performs certain processing upon request from other
tasks. This control request is posted through the mailbox.
In this example, task D performs a write to nonvolatile memory when a
request is made by another task. Tasks (tasks A, B, and C) make a request
by writing a nonvolatile memory offset address and write size in the
mailbox. Task D waits for mail. It reads messages in the order of request
occurrence, then writes data to nonvolatile memory.
Mailbox
Task A
Task B
Task C
Read
offset size
offset size
offset size
Write
Task D
Write
Nonvolatile
memory