• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.. _module-pw_chrono_freertos:
2
3------------------
4pw_chrono_freertos
5------------------
6``pw_chrono_freertos`` is a collection of ``pw_chrono`` backends that are
7implemented using FreeRTOS.
8
9.. warning::
10  This module is under construction, not ready for use, and the documentation
11  is incomplete.
12
13SystemClock backend
14-------------------
15The FreeRTOS based ``system_clock`` backend implements the
16``pw_chrono:system_clock`` facade by using ``xTaskGetTickCountFromISR()`` and
17``xTaskGetTickCount()`` based on the current context. An InterruptSpinLock is
18used to manage overflows in a thread and interrupt safe manner to produce a
19signed 64 bit timestamp.
20
21The ``SystemClock::now()`` must be used more than once per overflow of the
22native FreeRTOS ``xTaskGetTickCount*()`` overflow. Note that this duration may
23vary if ``portSUPPRESS_TICKS_AND_SLEEP()``, ``vTaskStepTick()``, and/or
24``xTaskCatchUpTicks()`` are used.
25
26Build targets
27-------------
28The GN build for ``pw_chrono_freertos`` has one target: ``system_clock``.
29The ``system_clock`` target provides the
30``pw_chrono_backend/system_clock_config.h`` and ``pw_chrono_freertos/config.h``
31headers and the backend for the ``pw_chrono:system_clock``.
32