Ewout van Bekkum | 41daf16 | 2021-03-03 13:57:28 -0800 | [diff] [blame] | 1 | .. _module-pw_chrono_embos: |
| 2 | |
| 3 | --------------- |
| 4 | pw_chrono_embos |
| 5 | --------------- |
| 6 | ``pw_chrono_embos`` is a collection of ``pw_chrono`` backends that are |
| 7 | implemented using embOS v4 for 32bit targets. |
| 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 embOS 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 ``OS_GetTime32()``. An |
| 17 | InterruptSpinLock is used to manage overflows in a thread and interrupt safe |
| 18 | manner to produce a signed 64 bit timestamp. Note that this does NOT use |
| 19 | ``OS_GetTime_us64()`` which is not always available, this could be considered |
| 20 | for a future alternative backend for the SystemClock. |
Ewout van Bekkum | 41daf16 | 2021-03-03 13:57:28 -0800 | [diff] [blame] | 21 | |
| 22 | The ``SystemClock::now()`` must be used more than once per overflow of the |
| 23 | native embOS ``OS_GetTime32()`` overflow. Note that this duration may |
| 24 | vary if ``OS_SUPPORT_TICKLESS`` is used. |
| 25 | |
| 26 | Build targets |
| 27 | ------------- |
| 28 | The GN build for ``pw_chrono_embos`` has one target: ``system_clock``. |
| 29 | The ``system_clock`` target provides the |
| 30 | ``pw_chrono_backend/system_clock_config.h`` and ``pw_chrono_embos/config.h`` |
| 31 | headers and the backend for the ``pw_chrono:system_clock``. |