Skip to content

Commit 2bc2dd4

Browse files
gmarullmarc-hb
authored andcommitted
doc: drop usage of numref
Usage of numfig=True option in conf.py significantly increases doc build time. While it is a nice feature, it's not extensively used in Zephyr documentation, so let's remove its usage in favor of faster doc builds. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent b6425b9 commit 2bc2dd4

File tree

5 files changed

+19
-43
lines changed

5 files changed

+19
-43
lines changed

doc/connectivity/bluetooth/bluetooth-audio-arch.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,11 @@ The Common Audio Profile introduces restrictions and requirements on the lower l
6666
The procedures in CAP works on one or more streams for one or more devices. Is it thus possible via
6767
CAP to do a single function call to setup multiple streams across multiple devices.
6868

69-
:numref:`bluetooth_audio_arch_cap_proc` shows a complete structure of the procedures in CAP and
69+
The figure below shows a complete structure of the procedures in CAP and
7070
how they correspond to procedures from the other profiles. The circles with I, A and C show whether
7171
the procedure has active involvement or requirements from the CAP Initiator, CAP Accept and CAP
7272
Commander roles respectively.
7373

74-
.. _bluetooth_audio_arch_cap_proc:
7574
.. figure:: img/cap_proc.svg
7675
:align: center
7776
:alt: Common Audio Profile Procedures

doc/hardware/pinctrl/index.rst

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,21 @@ debouncing, low-power modes, etc.
2323
The way pin control is implemented in hardware is vendor/SoC specific. It is
2424
common to find a *centralized* approach, that is, all pin configuration
2525
parameters are controlled by a single hardware block (typically named pinmux),
26-
including signal mapping. :numref:`pinctrl-hw-cent-control` illustrates this
26+
including signal mapping. The figure below illustrates this
2727
approach. ``PX0`` can be mapped to ``UART0_TX``, ``I2C0_SCK`` or ``SPI0_MOSI``
2828
depending on the ``AF`` control bits. Other configuration parameters such as
2929
pull-up/down are controlled in the same block via ``CONFIG`` bits. This model is
3030
used by several SoC families, such as many from NXP and STM32.
3131

32-
.. _pinctrl-hw-cent-control:
33-
3432
.. figure:: images/hw-cent-control.svg
3533

3634
Example of pin control centralized into a single per-pin block
3735

3836
Other vendors/SoCs use a *distributed* approach. In such case, the pin mapping
3937
and configuration are controlled by multiple hardware blocks.
40-
:numref:`pinctrl-hw-dist-control` illustrates a distributed approach where pin
38+
The figure below illustrates a distributed approach where pin
4139
mapping is controlled by peripherals, such as in Nordic nRF SoCs.
4240

43-
.. _pinctrl-hw-dist-control:
44-
4541
.. figure:: images/hw-dist-control.svg
4642

4743
Example pin control distributed between peripheral registers and per-pin block
@@ -75,13 +71,11 @@ depending on the operating conditions, for example, to enable a low-power mode
7571
when suspending the device. Such requirements are modeled using **states**, a
7672
concept that has been adapted from the one in the Linux kernel. Each device
7773
driver owns a set of states. Each state has a unique name and contains a full
78-
pin configuration set (see :numref:`pinctrl-states-model`). This effectively
74+
pin configuration set (see the figure below). This effectively
7975
means that states are independent of each other, so they do not need to be
8076
applied in any specific order. Another advantage of the state model is that it
8177
isolates device drivers from pin configuration.
8278

83-
.. _pinctrl-states-model:
84-
8579
.. table:: Example pin configuration encoded using the states model
8680
:align: center
8781

@@ -106,11 +100,9 @@ The name assigned to pin control states or the number of them is up to the
106100
device driver requirements. In many cases a single state applied at
107101
initialization time will be sufficient, but in some other cases more will be
108102
required. In order to make things consistent, a naming convention has been
109-
established for the most common use cases. :numref:`pinctrl-states-standard`
103+
established for the most common use cases. The figure below
110104
details the standardized states and its purpose.
111105

112-
.. _pinctrl-states-standard:
113-
114106
.. table:: Standardized state names
115107
:align: center
116108

doc/services/logging/index.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -535,23 +535,21 @@ There are three types of domains in a multi-domain system:
535535

536536
See the following image for an example of a multi-domain setup:
537537

538-
.. _logging-multidomain-example:
539-
540538
.. figure:: images/multidomain.png
541539

542540
Multi-domain example
543541

544542
In this architecture, a link can handle multiple domains.
545543
For example, let's consider an SoC with two ARM Cortex-M33 cores with TrustZone: cores A and B (see
546-
:numref:`logging-multidomain-example`). There are four domains in the system, as
544+
the example illustrated above). There are four domains in the system, as
547545
each core has both a Secure and a Nonsecure domain. If *core A nonsecure* (A_NS) is the
548546
root domain, it has two links: one to *core A secure* (A_NS-A_S) and one to
549547
*core B nonsecure* (A_NS-B_NS). *B_NS* domain has one link, to *core B secure*
550548
*B_NS-B_S*), and a backend to *A_NS*.
551549

552550
Since in all instances there is a standard logging subsystem, it is always possible
553551
to have multiple backends and simultaneously output messages to them. An example of this is shown
554-
on :numref:`logging-multidomain-example` as a dotted UART backend on the *B_NS* domain.
552+
in the illustration above as a dotted UART backend on the *B_NS* domain.
555553

556554
Domain ID
557555
---------
@@ -569,10 +567,9 @@ The first link has the offset set to 1.
569567
The following offset equals the previous link offset plus the number of domains in the previous
570568
link.
571569

572-
The following example is shown on :numref:`logging-domain-ids-example`, where
570+
The following example is shown below, where
573571
the assigned ``domain_ids`` are shown for each domain:
574572

575-
.. _logging-domain-ids-example:
576573
.. figure:: images/domain_ids.png
577574

578575
Domain IDs assigning example

doc/services/pm/device_runtime.rst

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,8 @@ increase device usage count and resume the device if necessary. Similarly, the
8484
:c:func:`pm_device_runtime_put` function can be used to indicate that the device
8585
is no longer needed. This function will decrease the device usage count and
8686
suspend the device if necessary. It is worth to note that in both cases, the
87-
operation is carried out synchronously. The sequence diagram shown in
88-
:numref:`pm_device_runtime_sync_ops` illustrates how a device can use this API
89-
and the expected sequence of events.
90-
91-
.. _pm_device_runtime_sync_ops:
87+
operation is carried out synchronously. The sequence diagram shown below
88+
illustrates how a device can use this API and the expected sequence of events.
9289

9390
.. figure:: images/devr-sync-ops.svg
9491

@@ -103,10 +100,7 @@ slow bus. For this reason the device drivers can also make use of the
103100
:c:func:`pm_device_runtime_put_async` function. This function will schedule
104101
the suspend operation, again, if device is no longer used. The suspension will
105102
then be carried out when the system work queue gets the chance to run. The
106-
sequence diagram in :numref:`pm_device_runtime_async_ops` illustrates this
107-
scenario.
108-
109-
.. _pm_device_runtime_async_ops:
103+
sequence diagram shown below illustrates this scenario.
110104

111105
.. figure:: images/devr-async-ops.svg
112106

doc/services/zbus/index.rst

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,36 @@ The :dfn:`Zephyr message bus - Zbus` is a lightweight and flexible message bus e
1212
Concepts
1313
********
1414

15-
Threads can broadcast messages to all interested observers using zbus. Many-to-many communication is possible. The bus implements message-passing and publish/subscribe communication paradigms that enable threads to communicate synchronously or asynchronously through shared memory. The communication through zbus is channel-based, where threads publish and read to and from using messages. Additionally, threads can observe channels and receive notifications from the bus when the channels are modified. :numref:`zbus common` shows an example of a typical application using zbus in which the application logic (hardware independent) talks to other threads via message bus. Note that the threads are decoupled from each other because they only use zbus' channels and do not need to know each other to talk.
15+
Threads can broadcast messages to all interested observers using zbus. Many-to-many communication is possible. The bus implements message-passing and publish/subscribe communication paradigms that enable threads to communicate synchronously or asynchronously through shared memory. The communication through zbus is channel-based, where threads publish and read to and from using messages. Additionally, threads can observe channels and receive notifications from the bus when the channels are modified. The figure below shows an example of a typical application using zbus in which the application logic (hardware independent) talks to other threads via message bus. Note that the threads are decoupled from each other because they only use zbus' channels and do not need to know each other to talk.
1616

1717

18-
.. _zbus common:
1918
.. figure:: images/zbus_overview.svg
2019
:alt: zbus usage overview
2120
:width: 75%
2221

2322
A typical zbus application architecture.
2423

25-
:numref:`zbus anatomy` illustrates zbus' anatomy. The bus comprises:
24+
The bus comprises:
2625

2726
* Set of channels that consists of a unique identifier, its control metadata information, and the message itself;
2827
* :dfn:`Virtual distributed event dispatcher` (VDED), the bus logic responsible for sending notifications to the observers. The VDED logic runs inside the publishing action in the same thread context, giving the bus an idea of a distributed execution. When a thread publishes to a channel, it also propagates the notifications to the observers;
2928
* Threads (subscribers) and callbacks (listeners) publishing, reading, and receiving notifications from the bus.
3029

31-
.. _zbus anatomy:
3230
.. figure:: images/zbus_anatomy.svg
3331
:alt: Zbus anatomy
3432
:width: 70%
3533

36-
Zbus internals details.
34+
Zbus anatomy.
3735

3836
The bus makes the publish, read, and subscribe actions available over channels. Publishing and reading are available in all RTOS thread contexts. However, it cannot run inside Interrupt Service Routines (ISR) because it uses mutexes to control channels access, and mutexes cannot work appropriately inside ISRs. The publish and read operations are simple and fast; the procedure is a mutex locking followed by a memory copy to and from a shared memory region and then a mutex unlocking. Another essential aspect of zbus is the observers, which can be:
3937

4038
* Static; defined in compile time. It is not possible to remove it at runtime, but it is possible to suppress it by calling the :c:func:`zbus_obs_set_enable`;
4139
* Dynamic; it can be added and removed to and from a channel at runtime.
4240

4341

44-
For illustration purposes, suppose a usual sensor-based solution in :numref:`zbus operations`. When the timer is triggered, it pushes an action to a work queue that publishes to the ``Start trigger`` channel. As the sensor thread subscribed to the ``Start trigger`` channel, it fetches the sensor data. Notice the VDED executes the blink callback because it also listens to the ``Start trigger`` channel. When the sensor data is ready, the sensor thread publishes it to the ``Sensor data`` channel. The core thread, as a ``Sensor data`` channel subscriber, processes the sensor data and stores it in an internal sample buffer. It repeats until the sample buffer is full; when it happens, the core thread aggregates the sample buffer information, prepares a package, and publishes that to the ``Payload`` channel. The Lora thread receives that because it is a ``Payload`` channel subscriber and sends the payload to the cloud. When it completes the transmission, the Lora thread publishes to the ``Transmission done`` channel. The VDED executes the blink callback again since it listens to the ``Transmission done`` channel.
42+
For illustration purposes, suppose a usual sensor-based solution in the figure below. When the timer is triggered, it pushes an action to a work queue that publishes to the ``Start trigger`` channel. As the sensor thread subscribed to the ``Start trigger`` channel, it fetches the sensor data. Notice the VDED executes the blink callback because it also listens to the ``Start trigger`` channel. When the sensor data is ready, the sensor thread publishes it to the ``Sensor data`` channel. The core thread, as a ``Sensor data`` channel subscriber, processes the sensor data and stores it in an internal sample buffer. It repeats until the sample buffer is full; when it happens, the core thread aggregates the sample buffer information, prepares a package, and publishes that to the ``Payload`` channel. The Lora thread receives that because it is a ``Payload`` channel subscriber and sends the payload to the cloud. When it completes the transmission, the Lora thread publishes to the ``Transmission done`` channel. The VDED executes the blink callback again since it listens to the ``Transmission done`` channel.
4543

4644

47-
.. _zbus operations:
4845
.. figure:: images/zbus_operations.svg
4946
:alt: Zbus sensor-based application
5047
:width: 80%
@@ -73,9 +70,8 @@ The VDED execution always happens in the publishing's (thread) context. So it ca
7370
* At last, the publishing function unlocks the channel.
7471

7572

76-
To illustrate the VDED execution, consider the example the :numref:`zbus vded scenario` shows. We have four threads in ascending priority T1, T2, T3, and T4 (the highest priority); two listeners, L1 and L2; and channel A. Suposing L1, L2, T2, T3, and T4 observer channel A.
73+
To illustrate the VDED execution, consider the example illustrated below. We have four threads in ascending priority T1, T2, T3, and T4 (the highest priority); two listeners, L1 and L2; and channel A. Suposing L1, L2, T2, T3, and T4 observer channel A.
7774

78-
.. _zbus vded scenario:
7975
.. figure:: images/zbus_publishing_process_example_scenario.svg
8076
:alt: Zbus example scenario
8177
:width: 55%
@@ -97,10 +93,9 @@ The following code implements channel A. Note the ``struct a_msg`` is illustrati
9793
);
9894
9995
100-
In :numref:`zbus vded`, the letters indicate some action related to the VDED execution. The X-axis represents the time, and the Y-axis represents the priority of threads. Channel A's message, represented by a voice balloon, is only one memory portion (shared memory). It appears several times only as an illustration of the message at that point in time.
96+
In the figure below, the letters indicate some action related to the VDED execution. The X-axis represents the time, and the Y-axis represents the priority of threads. Channel A's message, represented by a voice balloon, is only one memory portion (shared memory). It appears several times only as an illustration of the message at that point in time.
10197

10298

103-
.. _zbus vded:
10499
.. figure:: images/zbus_publishing_process_example.svg
105100
:alt: Zbus publish processing detail
106101
:width: 85%
@@ -109,10 +104,9 @@ In :numref:`zbus vded`, the letters indicate some action related to the VDED exe
109104

110105

111106

112-
The :numref:`zbus vded` illustrates the actions performed during the VDED execution when T1 publishes to channel A. Thus, :numref:`zbus vded table` describes the actions (represented by a letter) of the VDED execution.
107+
The figure above illustrates the actions performed during the VDED execution when T1 publishes to channel A. Thus, the figure below describes the actions (represented by a letter) of the VDED execution.
113108

114109

115-
.. _zbus vded table:
116110
.. list-table:: VDED execution steps in detail.
117111
:widths: 5 65
118112
:header-rows: 1
@@ -279,7 +273,7 @@ Messages are read from a channel in zbus by calling :c:func:`zbus_chan_read`. So
279273
Do not use this function inside an ISR.
280274

281275
.. warning::
282-
Choose the timeout of :c:func:`zbus_chan_read` after receiving a notification from :c:func:`zbus_sub_wait` carefully because the channel will always be unavailable during the VDED execution. Using ``K_NO_WAIT`` for reading is highly likely to return a timeout error if there are more than one subscriber. For example, consider the :numref:`zbus vded` again and notice how ``T3`` and ``T4's`` read attempts would definitely fail with K_NO_WAIT. For more details, check the `Virtual Distributed Event Dispatcher`_ section.
276+
Choose the timeout of :c:func:`zbus_chan_read` after receiving a notification from :c:func:`zbus_sub_wait` carefully because the channel will always be unavailable during the VDED execution. Using ``K_NO_WAIT`` for reading is highly likely to return a timeout error if there are more than one subscriber. For example, consider the VDED illustration again and notice how ``T3`` and ``T4's`` read attempts would definitely fail with K_NO_WAIT. For more details, check the `Virtual Distributed Event Dispatcher`_ section.
283277

284278
Forcing channel notification
285279
============================

0 commit comments

Comments
 (0)