Skip to content

Commit a90bb38

Browse files
committed
[genpinmap] Fix output format for AStyle
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
1 parent b144be3 commit a90bb38

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/genpinmap/genpinmap_arduino.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def print_adc():
382382

383383
for p in adclist:
384384
if "IN" in p[2]:
385-
s1 = "%-12s" % (" {" + p[0] + ",")
385+
s1 = "%-10s" % (" {" + p[0] + ",")
386386
a = p[2].split("_")
387387
inst = a[0].replace("ADC", "")
388388
if len(inst) == 0:
@@ -393,7 +393,7 @@ def print_adc():
393393
s1 += ", 0)}, // " + p[2] + "\n"
394394
out_c_file.write(s1)
395395
out_c_file.write(
396-
""" {NC, NP, 0}
396+
""" {NC, NP, 0}
397397
};
398398
#endif
399399
"""
@@ -403,7 +403,7 @@ def print_adc():
403403
def print_dac():
404404
for p in daclist:
405405
b = p[2]
406-
s1 = "%-12s" % (" {" + p[0] + ",")
406+
s1 = "%-10s" % (" {" + p[0] + ",")
407407
# 2nd element is the DAC signal
408408
if b[3] == "_": # 1 DAC in this chip
409409
s1 += (
@@ -425,7 +425,7 @@ def print_dac():
425425
)
426426
out_c_file.write(s1)
427427
out_c_file.write(
428-
""" {NC, NP, 0}
428+
""" {NC, NP, 0}
429429
};
430430
#endif
431431
"""
@@ -436,7 +436,7 @@ def print_i2c(lst):
436436
for p in lst:
437437
result = get_gpio_af_num(p[1], p[2])
438438
if result != "NOTFOUND":
439-
s1 = "%-12s" % (" {" + p[0] + ",")
439+
s1 = "%-10s" % (" {" + p[0] + ",")
440440
# 2nd element is the I2C XXX signal
441441
b = p[2].split("_")[0]
442442
s1 += (
@@ -449,7 +449,7 @@ def print_i2c(lst):
449449
s2 = s1 + af + ")},\n"
450450
out_c_file.write(s2)
451451
out_c_file.write(
452-
""" {NC, NP, 0}
452+
""" {NC, NP, 0}
453453
};
454454
#endif
455455
"""
@@ -460,7 +460,7 @@ def print_pwm():
460460
for p in pwm_list:
461461
result = get_gpio_af_num(p[1], p[2])
462462
if result != "NOTFOUND":
463-
s1 = "%-12s" % (" {" + p[0] + ",")
463+
s1 = "%-10s" % (" {" + p[0] + ",")
464464
# 2nd element is the PWM signal
465465
a = p[2].split("_")
466466
inst = a[0]
@@ -479,7 +479,7 @@ def print_pwm():
479479
s2 = s1 + af + ", " + chan + neg + ")}, // " + p[2] + "\n"
480480
out_c_file.write(s2)
481481
out_c_file.write(
482-
""" {NC, NP, 0}
482+
""" {NC, NP, 0}
483483
};
484484
#endif
485485
"""
@@ -490,7 +490,7 @@ def print_uart(lst):
490490
for p in lst:
491491
result = get_gpio_af_num(p[1], p[2])
492492
if result != "NOTFOUND":
493-
s1 = "%-12s" % (" {" + p[0] + ",")
493+
s1 = "%-10s" % (" {" + p[0] + ",")
494494
# 2nd element is the UART_XX signal
495495
b = p[2].split("_")[0]
496496
s1 += "%-9s" % (b[: len(b) - 1] + b[len(b) - 1 :] + ",")
@@ -503,7 +503,7 @@ def print_uart(lst):
503503
s2 = s1 + af + ")},\n"
504504
out_c_file.write(s2)
505505
out_c_file.write(
506-
""" {NC, NP, 0}
506+
""" {NC, NP, 0}
507507
};
508508
#endif
509509
"""
@@ -514,7 +514,7 @@ def print_spi(lst):
514514
for p in lst:
515515
result = get_gpio_af_num(p[1], p[2])
516516
if result != "NOTFOUND":
517-
s1 = "%-12s" % (" {" + p[0] + ",")
517+
s1 = "%-10s" % (" {" + p[0] + ",")
518518
# 2nd element is the SPI_XXXX signal
519519
instance = p[2].split("_")[0].replace("SPI", "")
520520
s1 += "SPI" + instance + ", STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, "
@@ -523,7 +523,7 @@ def print_spi(lst):
523523
s2 = s1 + af + ")},\n"
524524
out_c_file.write(s2)
525525
out_c_file.write(
526-
""" {NC, NP, 0}
526+
""" {NC, NP, 0}
527527
};
528528
#endif
529529
"""
@@ -534,7 +534,7 @@ def print_can(lst):
534534
for p in lst:
535535
result = get_gpio_af_num(p[1], p[2])
536536
if result != "NOTFOUND":
537-
s1 = "%-12s" % (" {" + p[0] + ",")
537+
s1 = "%-10s" % (" {" + p[0] + ",")
538538
# 2nd element is the CAN_XX signal
539539
instance = p[2].split("_")[0].replace("CAN", "")
540540
if len(instance) == 0:
@@ -548,7 +548,7 @@ def print_can(lst):
548548
s2 = s1 + af + ")},\n"
549549
out_c_file.write(s2)
550550
out_c_file.write(
551-
""" {NC, NP, 0}
551+
""" {NC, NP, 0}
552552
};
553553
#endif
554554
"""
@@ -560,7 +560,7 @@ def print_eth():
560560
for p in eth_list:
561561
result = get_gpio_af_num(p[1], p[2])
562562
if result != "NOTFOUND":
563-
s1 = "%-12s" % (" {" + p[0] + ",")
563+
s1 = "%-10s" % (" {" + p[0] + ",")
564564
# 2nd element is the ETH_XXXX signal
565565
s1 += "ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, " + result + ")},"
566566
# check duplicated lines, only signal differs
@@ -573,7 +573,7 @@ def print_eth():
573573
s1 += " // " + p[2]
574574
out_c_file.write(s1)
575575
out_c_file.write(
576-
"""\n {NC, NP, 0}
576+
"""\n {NC, NP, 0}
577577
};
578578
#endif
579579
"""
@@ -585,7 +585,7 @@ def print_qspi():
585585
for p in qspi_list:
586586
result = get_gpio_af_num(p[1], p[2])
587587
if result != "NOTFOUND":
588-
s1 = "%-12s" % (" {" + p[0] + ",")
588+
s1 = "%-10s" % (" {" + p[0] + ",")
589589
# 2nd element is the QUADSPI_XXXX signal
590590
s1 += "QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, " + result + ")},"
591591
# check duplicated lines, only signal differs
@@ -598,15 +598,15 @@ def print_qspi():
598598
s1 += " // " + p[2]
599599
out_c_file.write(s1)
600600
out_c_file.write(
601-
"""\n {NC, NP, 0}
601+
"""\n {NC, NP, 0}
602602
};
603603
#endif
604604
"""
605605
)
606606

607607

608608
def print_syswkup():
609-
out_h_file.write(" /* SYS_WKUP */\n")
609+
out_h_file.write(" /* SYS_WKUP */\n")
610610
# H7xx and F446 start from 0, inc by 1
611611
num = syswkup_list[0][2].replace("SYS_WKUP", "")
612612
inc = 0
@@ -629,10 +629,10 @@ def print_syswkup():
629629
num = p[2].replace("SYS_WKUP", "")
630630
if len(num) == 0:
631631
s1 = "#ifdef PWR_WAKEUP_PIN1\n"
632-
s1 += " SYS_WKUP1" # single SYS_WKUP for this product
632+
s1 += " SYS_WKUP1" # single SYS_WKUP for this product
633633
else:
634634
s1 = "#ifdef PWR_WAKEUP_PIN%i\n" % (int(num) + inc)
635-
s1 += " SYS_WKUP" + str(int(num) + inc)
635+
s1 += " SYS_WKUP" + str(int(num) + inc)
636636
s1 += " = " + p[0] + ","
637637
if (inc == 1) and (p[0] != "NC"):
638638
s1 += " /* " + p[2] + " */"

0 commit comments

Comments
 (0)