28-2
Inter-Task Messaging Tools
Programmer’s Manual
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 data representatiSyntax
the message being sent.
The data structure for the structure MESSAGE is:
typedef struct _MESSAGE
{
U16
U16
U32
P_VOID data;
U16
U16
messageType;
message;
misc;
/* message type */
/* message */
/* short data (32bit) */
/* associated data, if any */
/* size of data in bytes */
/* for future (broadcast, etc) */
size;
reserved;
} PPSM_MESSAGE, *P_MESSAGE;
If AppSwap(FALSE) is called before calling this function, the message will still
be sent but any form of task swapping action will be ignored.
If the system is in doze mode, calling this function will wake up the system.
Parameter
Name
Description
taskId
The receiver task identifier
msg
The message to send. All data to send are
stored in the PPSM_MESSAGE structure,
with the following representation:
messageType - Must set to
MESSAGE_IRPT.
message - The type of message
being sent to the receiver.
Normally set to IRPT_USER.
misc - 32-bit short data
data - data pointer to the buffer that
is storing the message data
size - size of data buffer, in number
of bytes
reserved - not used
flag
It can be:
SWAP_TASK_LATER - Task swapping
will happen in IrptGetData() when all
messages in current task are handled.
SWAP_TASK_BACK_LATER - Task
swapping will happen immediately if the
pen is not touching the panel and the
current task will be swapped back when all
messages in the target task are handled.
SWAP_TASK - Task swapping will happen
immediately if the pen is not touching the
panel.
NO_SWAP_TASK - No task swapping will
happen.
Personal Portable System Manager
Programmer’s Manual
27-7
STATUS
TaskTerminate
Description
Termination of a task. The task identifier can be of a main or sub task. All
system memory, such as stack memory and screen (if any), associated with
the task and its subtasks that are allocated by PPSM will be freed.
A task cannot terminate itself nor its parent task if it is a sub-task.
TaskTerminate() will not free the memory that has been explicitly allocated by
the task with Lmalloc().
Parameter
Return Value
Name
Description
taskId
Name
Description
PPSM_OK
Task successfully terminated
PPSM_ERR_TASK_ID
Invalid task identifier
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.