Skip to content

Commit c8942af

Browse files
tejlmandmbolivar-nordic
authored andcommitted
doc: add commas in macro arguments to Kconfig tips
Kconfig uses commas to separate macro arguments. Improve Kconfig documentation by describing to users how this can be handled when using devicetree Kconfig macros when using devicetree names which may have commas in them. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
1 parent 6be9666 commit c8942af

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

doc/build/kconfig/tips.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,30 @@ invisible:
593593
[*] All my children are invisible ----
594594
595595
596+
Commas in macro arguments
597+
*************************
598+
599+
Kconfig uses commas to separate macro arguments.
600+
This means a construct like this will fail:
601+
602+
.. code-block:: none
603+
604+
config FOO
605+
bool
606+
default y if $(dt_chosen_enabled,"zephyr,bar")
607+
608+
To solve this problem, create a variable with the text and use this variable as
609+
argument, as follows:
610+
611+
.. code-block:: none
612+
613+
DT_CHOSEN_ZEPHYR_BAR := zephyr,bar
614+
615+
config FOO
616+
bool
617+
default y if $(dt_chosen_enabled,$(DT_CHOSEN_ZEPHYR_BAR))
618+
619+
596620
Checking changes in menuconfig/guiconfig
597621
****************************************
598622

0 commit comments

Comments
 (0)