From 36efee9187390a52a99919b900b8faaea49be928 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Fri, 22 Jan 2021 01:07:55 +0100 Subject: templates/periph_instances: Add aliases. --- templates/periph_instances.h.j2 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'templates') 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 %} -- cgit v1.2.3