Skip to content
Commit 8346032d authored by Martí Bolívar's avatar Martí Bolívar Committed by Christopher Friedt
Browse files

cmake: extensions: improve DT consistency with python APIs



In the python APIs we use for devicetree, you can generally use an
alias interchangeably with the full path to a node.

For example, dtlib.py says:

    [...] both dt.get_node("/foo/bar") and dt.get_node("bar-alias")
    will return the 'bar' node below:

      /dts-v1/;

      / {
              foo {
                      bar_label: bar {
                              baz {
                              };
                      };
              };

              aliases {
                      bar-alias = &bar-label;
              };
      };

    Fetching subnodes via aliases is supported:
    dt.get_node("bar-alias/baz") returns the 'baz' node.

Now that we have the necessary helper functions for resolving alias
names, make the CMake APIs to devicetree behave the same way. This
improves consistency between the two sets of devicetree helpers used
by the build system, making them both match the general devicetree
practice that an alias is as good as a path. This is good for
consistency.

Signed-off-by: default avatarMartí Bolívar <marti.bolivar@nordicsemi.no>
parent ecece731
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment