4c8ed7dd9a
The macro is searching for all instances of specific device that contain specific property and evaluates to true (1) if any device does. The macro used to do that by generating, using DT_ANY_INST_HAS_PROP_STATUS_OKAY, a logical expression like (0 || 1 || 0), where each digit represented existence of property (1) or lack of it (0). Unfortunately other util macros, like IS_ENABLED, were not able to evaluate such expression, as they often simply expect something they can evaluate to 0 or 1. The commit here changes DT_ANY_INST_HAS_PROP_STATUS_OKAY to generate a list of tokens (1) where token is added to list only for instance of a device that has the property; then such list is processed using IS_EMPTY() macro and in the end 0 or 1 is generated, depending on whether any enabled instance of a device has the property or not. This change allows result of DT_ANY_INST_HAS_PROP_STATUS_OKAY to be used with macros like IS_ENABLED, IF_ENABLED or COND_CODE_x. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no> |
||
---|---|---|
.. | ||
src | ||
app.overlay | ||
CMakeLists.txt | ||
prj.conf | ||
README | ||
testcase.yaml |
Test cases for the devicetree.h API.