Skip to content

Commit 3a5a025

Browse files
committed
script: stm32variant: fix wrong index in digitalPin[]
Template loop.index is 1 base index while Dx is 0. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 6e8cfdf commit 3a5a025

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CI/utils/templates/variant_generic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
const PinName digitalPin[] = {
1919
{% for pinname in pinnames_list %}
2020
{% if not loop.last %}
21-
{{"%-7s // %s"|format("{},".format(pinname.name), "D{}{}".format(loop.index, "" if pinname.ax == -1 else "/A{}".format(pinname.ax)))}}
21+
{{"%-7s // %s"|format("{},".format(pinname.name), "D{}{}".format(loop.index-1, "" if pinname.ax == -1 else "/A{}".format(pinname.ax)))}}
2222
{% else %}
23-
{{"%-7s // %s"|format(pinname.name, "D{}{}".format(loop.index, "" if pinname.ax == -1 else "/A{}".format(pinname.ax)))}}
23+
{{"%-7s // %s"|format(pinname.name, "D{}{}".format(loop.index-1, "" if pinname.ax == -1 else "/A{}".format(pinname.ax)))}}
2424
{% endif %}
2525
{% endfor %}
2626
};

0 commit comments

Comments
 (0)