doc: Add documentation for using private events
This reflects the changes made in commit df6be15aa5... Change-Id: Ibe1bc167390268c0e335a0b4060a600ef55d1add Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
parent
1b45249471
commit
935a809cc6
1 changed files with 22 additions and 3 deletions
|
@ -81,7 +81,7 @@ The following parameters must be defined:
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
If no event handler is required specify :cpp:macro:`NULL`.
|
If no event handler is required specify :c:macro:`NULL`.
|
||||||
|
|
||||||
Public Event
|
Public Event
|
||||||
------------
|
------------
|
||||||
|
@ -105,8 +105,27 @@ as follows:
|
||||||
A public event can be referenced by name from any source file that includes
|
A public event can be referenced by name from any source file that includes
|
||||||
the file :file:`zephyr.h`.
|
the file :file:`zephyr.h`.
|
||||||
|
|
||||||
.. note::
|
Private Event
|
||||||
Private events are not supported by the Zephyr kernel.
|
-------------
|
||||||
|
|
||||||
|
Define the event in a source file using the following syntax:
|
||||||
|
|
||||||
|
.. code-block:: c
|
||||||
|
|
||||||
|
DEFINE_EVENT(name, handler);
|
||||||
|
|
||||||
|
For example, the following code defines a private event named ``PRIV_EVENT``,
|
||||||
|
which has no associated event handler function.
|
||||||
|
|
||||||
|
.. code-block:: c
|
||||||
|
|
||||||
|
DEFINE_EVENT(PRIV_EVENT, NULL);
|
||||||
|
|
||||||
|
To utilize this event from a different source file use the following syntax:
|
||||||
|
|
||||||
|
.. code-block:: c
|
||||||
|
|
||||||
|
extern const kevent_t PRIV_EVENT;
|
||||||
|
|
||||||
Example: Signaling an Event from an ISR
|
Example: Signaling an Event from an ISR
|
||||||
========================================
|
========================================
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue