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