Skip to content
Commit b6fb701f authored by Jordan Yates's avatar Jordan Yates Committed by Marti Bolivar
Browse files

devicetree: add `DT_ENUM_HAS_VALUE`



Add a macro for checking if an enumeration matches a given value.
This enables code to directly check whether a string enumeration is a
specific value, without needing to construct an intermediate variable,
and without checking against a index value which may change.

```
/* Enables this */
if (DT_INST_ENUM_HAS_VALUE(0, power_amplifier_output, rfo_hp)) {}
/* Instead of this */
if (DT_INST_ENUM_IDX(0, power_amplifier_output) == 0) {}
```

Signed-off-by: default avatarJordan Yates <jordan.yates@data61.csiro.au>
parent 59167e18
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment