Download 8051 RTOS

Transcript
Interprocess Communication
6. Configure the Receive Message Objects in the application OIL file.
You configure an unqueued receive message object by defining a MESSAGE OIL object with its
value for its MESSAGEPROPERTY set to RECEIVE_UNQUEUED_INTERNAL.
You configure a queued receive message object by defining a
MESSAGE OIL object with its value for its MESSAGEPROPERTY set to
RECEIVE_QUEUED_INTERNAL. The subattribute QUEUESIZE defines the length of the receive
queue.
In both cases, the subattribute SENDINGMESSAGE defines which is the related Send Message
Object. In our example:
MESSAGE recMU
{
MESSAGEPROPERTY = RECEIVE_UNQUEUED_INTERNAL;
{
SENDINGMESSAGE = sendM;
};
};
MESSAGE recMQTaskC
{
MESSAGEPROPERTY = RECEIVE_QUEUED_INTERNAL;
{
SENDINGMESSAGE = sendM;
QUEUESIZE
= 5;
};
};
7. Configure the receivers of the messages.
The receivers of the message M are those TASK and/or ISR OIL objects which can use the system
service ReceiveMessage() to read the transmitted data of message M.
The OSEK/VDX standard offers you the standard attribute MESSAGE (a multiple reference of type
MESSAGE_TYPE) in the TASK/ISR OIL objects to add messages to the list of messages owned by
the TASK or ISR.
To define the TASK TaskB and the ISR ISRA as unqueud receivers for message M you need to add
recMU to the message list of the TaskB and ISRA objects. And to define the TASK TaskC as a
queued receiver for message M you need to add recMQTaskC to the message list of the TaskC'
object:
TASK TaskB
{
MESSAGE =
};
recMU;
10-5