![](http://datasheet.mmic.net.cn/260000/PPSMMANUAL_datasheet_15946768/PPSMMANUAL_80.png)
14-4
Inter-TInter-Task Messaging
Programmer’s Manual
not known, this tool cannot be used.
All data that the sender wants to send must be stored in the form of MESSAGE
structure. No protocol or data format is put on the message data. The sender and
receiver must have a mutual understanding of the representation of the data being
transferred.
14.4
Advanced Sending Message
STATUS
AdvSendMessage
(U32 taskId P_MESSAGE msg, U8 flag)
This is similar to SendMessage() except it enhances the task swapping control.
The flagcan control whether the target task is swapped in immediately or later. It
also controls whether the current task will be swapped in again after all messages
in target task are handled.
If msg is NULL, this is a task swapping control function without message passing.
If flag is NO_TASK_SWAP, this is a message passing tool without task swapping
control.
14.5
Deleting Message for Current Task
STATUS
MessageDelete
(U16 type)
This is for deleting all messages in current task with the same type as the input
parameter such as IRPT_PEN, IRPT_UART, etc.
14.6
Deleting Message for any Task
STATUS
AdvMessageDelete
(U32 taskId U16 type, U32 shortData)
This is for deleting messages in specific task matching the type and shortData.
The short data here refers to the area id. for active area, timeout id. for reference
timer, etc. If taskIdis 0xFFFFFFFF and the current task is a main task, all
messages in main task queue with matching type and shortDatawill be deleted. If
the taskId is 0xFFFFFFFF and the current task is a subtask, all messages with
matching typeand shortData in current sub task list will be deleted. If the type is
0xFFFF, all messages with matching taskIdand shortDatawill be deleted.
If typeis 0xFFFF and shortData is 0xFFFFFFFF, all messages in the specific task
will be deleted.
14.7
Receiving Message
STATUS
IrptGetData
(P_U32 sData, P_U32 *data P_U32 size)
This tool is used to receive the messages sent by another task, as well as to
receive the standard software interrupt message (see Section 29.1 - IrptGetData).
Personal Portable System Manager
Programmer’s Manual
14-5
The arguments returned by this tool can be mapped directly to the data stored in
the MESSAGE structure sent by the SendMessage() tool. They are as follows:
75
76
STATUS UartDemo()
{
P_U16 inData;
U8
U32
.
.
.
135 {
136 switch (IrptGetData( (P_U32)&id, (P_U32*)&inData, (P_U32)&size))
137
{
138
case IRPT_UART:
139
switch (*inData)
140
{
141
case UART_DATA_RECEIVED:
142
143
/* Data has been received, read data from system */
selected;
size, id;
Data Type
Data field in MESSAGE structure
Data Type
return value
STATUS
message
U16
sData
P_U32
misc
U32
data
P_U32*
data
P_VOID
P_U32
size
U16
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.