- 129 -
<<Example format of a message>>
typedef struct user_msg{
T_MSG t_msg; /* T_MSG structure */
B data[16]; /* User message data */
} USER_MSG;
<<Example format of a message with priority included>>
typedef struct user_msg{
T_MSG_PRI t_msg; /* T_MSG_PRI structure */
B data[16]; /* User message data */
} USER_MSG;
[
[[
[
E
Ex
xa
am
mp
pl
le
e
p
pr
ro
og
gr
ra
am
m
s
st
ta
at
te
em
me
en
nt
t
]
]]
]
<<Example statement in C language>>
#include <itron.h>
#include <kernel.h>
#include “kernel_id.h”
typedef struct pri_message
{
T_MSG_PRI msgheader;
char body[12];
} PRI_MSG;
void task(void)
{
PRI_MSG msg;
:
msg.msgpri = 5;
snd_mbx( ID_msg,(T_MSG *)&msg);
:
}
<<Example statement in assembly language>>
.include mr100.inc
.GLB task
_g_userMsg: .blkb 6 ; Header
.blkb 12 ; Body
task: :
PUSH.W R2
PUSH.L A1
snd_mbx #ID_MBX1,#_g_userMsg
: