Skip to content

Commit

Permalink
doc: devicetree: Fix highlighting of code blocks
Browse files Browse the repository at this point in the history
Make sure devicetree code blocks all have proper pygments language set.
Fixed a few other "none" code blocks as well.

(cherry picked from commit 57c17da)

Original-Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
GitOrigin-RevId: 57c17da
Change-Id: Iffdcf2d6b6d4e2ff707cd9811eb8e90ae8ac2724
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4952692
Commit-Queue: Tristan Honscheid <honscheid@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Tested-by: Tristan Honscheid <honscheid@google.com>
  • Loading branch information
kartben authored and Chromeos LUCI committed Oct 18, 2023
1 parent 604e00b commit 66fd8b2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
13 changes: 8 additions & 5 deletions doc/build/dts/howtos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ that the node has ``status = "okay"``, like this:
If you see the ``#error`` output, make sure to enable the node in your
devicetree. In some situations your code will compile but it will fail to link
with a message similar to::
with a message similar to:

.. code-block:: none
...undefined reference to `__device_dts_ord_N'
collect2: error: ld returned 1 exit status
Expand Down Expand Up @@ -299,6 +301,7 @@ For example, if your BOARD.dts contains this node:
These are equivalent ways to override the ``current-speed`` value in an
overlay:

.. Disable syntax highlighting as this construct does not seem supported by pygments
.. code-block:: none
/* Option 1 */
Expand All @@ -316,7 +319,7 @@ We'll use the ``&serial0`` style for the rest of these examples.
You can add aliases to your devicetree using overlays: an alias is just a
property of the ``/aliases`` node. For example:

.. code-block:: none
.. code-block:: devicetree
/ {
aliases {
Expand All @@ -326,7 +329,7 @@ property of the ``/aliases`` node. For example:
Chosen nodes work the same way. For example:

.. code-block:: none
.. code-block:: devicetree
/ {
chosen {
Expand All @@ -337,7 +340,7 @@ Chosen nodes work the same way. For example:
To delete a property (in addition to deleting properties in general, this is
how to set a boolean property to false if it's true in BOARD.dts):

.. code-block:: none
.. code-block:: devicetree
&serial0 {
/delete-property/ some-unwanted-property;
Expand All @@ -346,7 +349,7 @@ how to set a boolean property to false if it's true in BOARD.dts):
You can add subnodes using overlays. For example, to configure a SPI or I2C
child device on an existing bus node, do something like this:

.. code-block:: none
.. code-block:: devicetree
/* SPI device example */
&spi1 {
Expand Down
4 changes: 3 additions & 1 deletion doc/build/dts/intro-input-output.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ There are four types of devicetree input files:
- overlays (``.overlay``)
- bindings (``.yaml``)

The devicetree files inside the :file:`zephyr` directory look like this::
The devicetree files inside the :file:`zephyr` directory look like this:

.. code-block:: none
boards/<ARCH>/<BOARD>/<BOARD>.dts
dts/common/skeleton.dtsi
Expand Down
8 changes: 5 additions & 3 deletions doc/build/dts/intro-syntax-structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,11 @@ Additional notes on the above:
that order.

- Parentheses, arithmetic operators, and bitwise operators are allowed. The
``bar`` property contains a single cell with value 64::
``bar`` property contains a single cell with value 64:

bar = <(2 * (1 << 5))>;
.. code-block:: devicetree
bar = <(2 * (1 << 5))>;
Note that the entire expression must be parenthesized.

Expand Down Expand Up @@ -419,7 +421,7 @@ Additional notes on the above:
- Array and similar type property values can be split into several ``<>``
blocks, like this:

.. code-block:: none
.. code-block:: devicetree
foo = <1 2>, <3 4>; // Okay for 'type: array'
foo = <&label1 &label2>, <&label3 &label4>; // Okay for 'type: phandles'
Expand Down
2 changes: 1 addition & 1 deletion doc/build/dts/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ as you enable the devicetree node. Otherwise, it is sometimes as simple as
adding a line like this to your application's :file:`prj.conf` file and then
making sure to :ref:`dt-trouble-try-pristine`:

.. code-block:: none
.. code-block:: cfg
CONFIG_FOO=y
Expand Down

0 comments on commit 66fd8b2

Please sign in to comment.