![](http://datasheet.mmic.net.cn/260000/PPSMMANUAL_datasheet_15946768/PPSMMANUAL_78.png)
13-10
Programmer’s Manual
Personal Portable System Manager
Programmer’s Manual
Inter-TasTask Management
14-1
Chapter 14 Inter-Task Messaging
PPSM supports asynchronous message passing between tasks using the
provided tools. This tool cannot be used to pass message between sub tasks with
different parent tasks.
The sender task sends out the message stored in the pre-defined message
structure using the tool SendMessage() or AdvSendMessage(). It must know the
task identifier of the task that it wants to send the message to.
The receiving task receives the sent message in it’s software interrupt buffer, in
the same way as other interrupt messages sent from PPSM system. Accessing
this message by the application is done by using the IrptGetData() tool.
The messaging tool enables applications to:
notify other applications of user defined events
pass data between tasks within the system
swap to the specified task immediately or later
The format of the data passed by these tools are not defined. The caller and
receiver must have their own mutual agreement on the form of data being sent.
PPSM only performs the actual message passing and informing the receiving
application task of the arrival of the message.
The AdvSendMessage() can be used to control task swapping sequence with or
without message passing.
This can be used to send message to the task itself. Whenever these functions
are called to send message or control task swapping in interrupt routines when
the system is in doze mode, it will wake up the system.
14.1
Message Passing
Message can be sent between any tasks even the current task itself.
SendMessage() will send message to the target task and set the flag to swap to
the target task once all messages for current task are handled.
AdvSendMessage() has more flexibility. Task swapping can happen without any
message sent to the target task using AdvSendMessage(). AdvSendMessage()
can be used to send message to target task without task swapping which is used
as a purely message passing tool.
Example 14-1 Multiple swap task later
TaskA()
{
......
SendMessage(taskBId, msg);
SendMessage(taskCId, msg);
.....
}
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.