Skip to content

Commit d99415a

Browse files
committed
devicetree: Define DT_NODE_HAS_STATUS if not ZTEST_UNITTEST
linker-defs.h does a weird trick around DT_NODE_HAS_STATUS. The issue is that intrications of includes might anyway end up including linker-defs.h and devicetree.h (as it requires other macros in that last header). Signed-off-by: Tomasz Bursztyka <[email protected]>
1 parent ae8913a commit d99415a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/zephyr/devicetree.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3564,8 +3564,10 @@
35643564
* @param status a status as one of the tokens okay or disabled, not a string
35653565
* @return 1 if the node has the given status, 0 otherwise.
35663566
*/
3567+
#ifndef ZTEST_UNITTEST /* If ZTEST_UNITTEST, a dummy version will be defined */
35673568
#define DT_NODE_HAS_STATUS(node_id, status) \
35683569
DT_NODE_HAS_STATUS_INTERNAL(node_id, status)
3570+
#endif /* ZTEST_UNITTEST */
35693571

35703572
/**
35713573
* @brief Does a node identifier refer to a node with a status `okay`?

0 commit comments

Comments
 (0)