blob: 419eb002d09f39eb0e403b550d835c74e9d70ed9 [file] [log] [blame]
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -08001.. _module-pw_chrono_threadx:
2
Ewout van Bekkuma25df5f2021-04-09 18:10:49 -07003-----------------
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -08004pw_chrono_threadx
5-----------------
6``pw_chrono_threadx`` is a collection of ``pw_chrono`` backends that are
7implemented using ThreadX.
8
9.. warning::
10 This module is under construction, not ready for use, and the documentation
11 is incomplete.
12
13SystemClock backend
14-------------------
15The ThreadX based ``system_clock`` backend implements the
Ewout van Bekkumda2a62d2021-03-12 11:34:47 -080016``pw_chrono:system_clock`` facade by using ``tx_time_get()``. An
17InterruptSpinLock is used to manage overflows in a thread and interrupt safe
18manner to produce a signed 64 bit timestamp.
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -080019
20The ``SystemClock::now()`` must be used more than once per overflow of the
21native ThreadX ``tx_time_get()`` overflow. Note that this duration may vary if
22``tx_time_set()`` is used.
23
24.. warning::
Ewout van Bekkuma25df5f2021-04-09 18:10:49 -070025 Note that this is not compatible with TX_NO_TIMER as this disables
26 ``tx_time_get()``.
Ewout van Bekkumf7e38b32020-11-16 11:56:41 -080027
28Build targets
29-------------
30The GN build for ``pw_chrono_threadx`` has one target: ``system_clock``.
31The ``system_clock`` target provides the
32``pw_chrono_backend/system_clock_config.h`` and ``pw_chrono_threadx/config.h``
33headers and the backend for the ``pw_chrono:system_clock``.