-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.. _how_it_works: | ||
|
||
How it works | ||
============ | ||
|
||
To be added | ||
|
||
.. toctree:: | ||
:maxdepth: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ User manual | |
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
format-specifier | ||
format-specifier | ||
thread-safety |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.. _thread_safety: | ||
|
||
Thread safety | ||
============= | ||
|
||
With default configuration, LwPRINTF library is *not* thread safe. | ||
This means whenever it is used with operating system, user must resolve it with care. | ||
|
||
Library has locking mechanism support for thread safety, which needs to be enabled manually. | ||
|
||
.. tip:: | ||
To enable thread-safety support, parameter ``LWPRINTF_CFG_OS`` must be set to ``1``. | ||
Please check :ref:`api_lwprintf_opt` for more information about other options. | ||
|
||
After thread-safety features has been enabled, it is necessary to implement | ||
``4`` low-level system functions. | ||
|
||
.. tip:: | ||
System function template example is available in ``lwprintf/src/system/`` folder. | ||
|
||
Example code for ``CMSIS-OS V2`` | ||
|
||
.. note:: | ||
Check :ref:`api_lwprintf_sys` section for function description | ||
|
||
.. literalinclude:: ../../lwprintf/src/system/lwprintf_sys_cmsis_os.c | ||
:language: c | ||
:linenos: | ||
:caption: System function implementation for CMSIS-OS based operating systems | ||
|
||
.. toctree:: | ||
:maxdepth: 2 |