zephyr/doc/build
Gerard Marull-Paretas fff9ecbc7f devicetree: add DT_(INST_)FOREACH_CHILD(_STATUS_OKAY)_SEP(_VARGS)
It is frequent to see in Devicetree code constructs like:

```c
 #define NAME_AND_COMMA(node_id) DT_NODE_FULL_NAME(node_id),

const char *child_names[] = {
	DT_FOREACH_CHILD(DT_NODELABEL(n), NAME_AND_COMMA)
};
```

That is, an auxiliary macro to append a separator character in
DT_FOREACH* macros. Non-DT API, e.g. FOR_EACH(), takes a separator
argument to avoid such intermediate macros.

This patch adds DT_FOREACH_CHILD_SEP (and instance/status okay/vargs
versions of it). They all take an extra argument: a separator. With this
change, the example above can be simplified to:

```c
const char *child_labels[] = {
	DT_FOREACH_CHILD(DT_NODELABEL(n), DT_NODE_FULL_NAME, (,))
};
```

Notes:
- Other DT_FOREACH* macros could/should be extended as well

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-30 16:19:57 +02:00
..
cmake devicetree: s/devicetree_unfixed/devicetree_generated 2022-08-11 12:17:02 +02:00
dts devicetree: add DT_(INST_)FOREACH_CHILD(_STATUS_OKAY)_SEP(_VARGS) 2022-08-30 16:19:57 +02:00
kconfig doc: kconfig: Clarify note describing overriding default n 2022-08-15 08:18:46 +00:00
sysbuild doc: remove BUILD_ALWAYS True from sysbuild documentation 2022-08-15 12:07:37 -07:00
index.rst doc: sysbuild documentation guide 2022-08-12 13:56:55 +02:00
zephyr_cmake_package.rst doc: zephyr_cmake_package: fix obsolete text 2022-08-19 12:09:22 +02:00