diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2021-01-22 01:07:55 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2021-01-22 01:07:55 +0100 |
commit | 36efee9187390a52a99919b900b8faaea49be928 (patch) | |
tree | 9b9324a2f81ea37e08b716c421130f731828e0e3 | |
parent | 9741ea9c219364bc1aaf897a16b8c3a295c2cc10 (diff) |
templates/periph_instances: Add aliases.
-rw-r--r-- | templates/periph_instances.h.j2 | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/templates/periph_instances.h.j2 b/templates/periph_instances.h.j2 index 05c59df..3d236b7 100644 --- a/templates/periph_instances.h.j2 +++ b/templates/periph_instances.h.j2 @@ -1,11 +1,17 @@ #pragma once -{% for header in headers %}#include "{{ header }}"{% endfor %} +{% for header in (headers if headers else []) %} +#include "{{ header }}" +{% endfor %} -{% for instance in instances %} +{% for instance in (instances if instances else []) %} constexpr {{ instance.type }} {{ instance.name }}{ {% for arg in instance.args %} {{ arg | hex }}, {% endfor %} }; {% endfor %} + +{% for alias, ref in (aliases.items() if aliases else {}) %} +constexpr auto {{ alias }} = {{ ref }}; +{% endfor %} |