Renesas M3T-MR100 Network Card User Manual


 
- 132 -
[
[
[
[
E
E
x
x
a
a
m
m
p
p
l
l
e
e
p
p
r
r
o
o
g
g
r
r
a
a
m
m
s
s
t
t
a
a
t
t
e
e
m
m
e
e
n
n
t
t
]
]
]
]
<<Example statement in C language>>
#include <itron.h>
#include <kernel.h>
#include “kernel_id.h”
typedef struct fifo_message
{
T_MSG head;
char body[12];
} FIFO_MSG;
void task()
{
FIFO_MSG *msg;
:
if( rcv_mbx((T_MSG **)&msg, ID_mbx) == E_RLWAI )
error(“forced wakeup\n”);
:
:
if( prcv_mbx((T_MSG **)&msg, ID_mbx) != E_TMOUT )
error(“Timeout\n”);
:
:
if( trcv_mbx((T_MSG **)&msg, ID_mbx,10) != E_TMOUT )
error(“Timeout\n”);
:
}
<<Example statement in assembly language>>
.include mr100.inc
.GLB task
task:
:
PUSH.W R2
PUSHM R6R4
trcv_mbx #ID_MBX1,#100
:
PUSH.W R2
rcv_mbx #ID_MBX1
:
PUSH.W R2
prcv_mbx #ID_MBX1
: