devicetree: Add DT_HAS_ALIAS macro
Add 'DT_HAS_ALIAS' macro to verify node alias existence. Signed-off-by: James Roy <rruuaanng@outlook.com>
This commit is contained in:
parent
3734268f90
commit
28238d03ad
3 changed files with 11 additions and 0 deletions
|
@ -127,6 +127,8 @@ ZTEST(devicetree_api, test_path_props)
|
|||
|
||||
ZTEST(devicetree_api, test_alias_props)
|
||||
{
|
||||
zassert_equal(DT_HAS_ALIAS(test_alias), 1, "");
|
||||
zassert_equal(DT_HAS_ALIAS(test_alias_none), 0, "");
|
||||
zassert_equal(DT_NUM_REGS(TEST_ALIAS), 1, "");
|
||||
zassert_equal(DT_REG_ADDR(TEST_ALIAS), 0xdeadbeef, "");
|
||||
zassert_equal(DT_REG_SIZE(TEST_ALIAS), 0x1000, "");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue