User`s guide

Architecture
5-26 AT85C51SND3Bx Firmware User’s Guide
7691A–MP3–08/07
5.3.3.2 Messages
Management
The following functions located in file “lib_system\mailbox\mail.cmake it possible the
mailing and the delivery of messages.
Figure 5-6. Mailbox interface functions
These two mailboxes can store up to 8 messages according to the configuration done in
file “config.h”.
5.3.4 MMI Manager task
The MMI Manager task (also named “mmgr_kernel”) is dedicated in the management of
the MMI applications. It can be split into three processes:
Keyboard management: filters key bouncing and mails event messages when
actions on keys
Software timers: are 32-bit timers dedicated to MMI applications and mails event
messages when the timer overflows
Application manager: manages the execution of MMI applications running at the
same time and mails some events
5.3.4.1 Application Manager
Principles
The management of MMI applications is based on a LIFO stack that keeps in memory
the applications launched and runs them in the order in which they have been launched.
Thus, the last application launched (being at the top of the stack) is the first executed to
treat the input event. If this event was not dedicated to the top application, it is forwarded
to the following one stacked. Thus, several applications can be launched and run inde-
pendently at the same time, making easy and flexible the development of the custom
MMI layer. See Figure 5-7.
Command
mailbox
Event
mailbox
mail_send_event(
U8 evt_id, U16 param
);
mail_send_command(
U16 cmd_id, U16 param
);
mail_get_event(
U8 task_id, Msg *p_evt_msg
);
mail_send_command(
CMD_USB_START, 0
);
mail_get_command(
U8 task_id, Msg *p_cmd_msg
);
mail_get_command(
TASK_MASS, &cmd_msg
);
mail_get_event(
TASK_MASS, &evt_msg
);
mail_send_event(
EVT_USB_POWERED, 0
);
Command
mailbox
Event
mailbox
mail_send_event(
U8 evt_id, U16 param
);
mail_send_command(
U16 cmd_id, U16 param
);
mail_get_event(
U8 task_id, Msg *p_evt_msg
);
mail_send_command(
CMD_USB_START, 0
);
mail_get_command(
U8 task_id, Msg *p_cmd_msg
);
mail_get_command(
TASK_MASS, &cmd_msg
);
mail_get_event(
TASK_MASS, &evt_msg
);
mail_send_event(
EVT_USB_POWERED, 0
);