@@ -372,9 +372,13 @@ def print_all_lists():
372
372
print_spi (spisclk_list )
373
373
if print_list_header ("" , "SPI_SSEL" , "SPI" , spissel_list ):
374
374
print_spi (spissel_list )
375
- if print_list_header ("CAN" , "CAN_RD" , "CAN" , canrd_list , cantd_list ):
375
+ if len (canrd_list ) and "FDCAN" in canrd_list [0 ][2 ]:
376
+ canname = "FDCAN"
377
+ else :
378
+ canname = "CAN"
379
+ if print_list_header (canname , "CAN_RD" , canname , canrd_list , cantd_list ):
376
380
print_can (canrd_list )
377
- if print_list_header ("" , "CAN_TD" , "CAN" , cantd_list ):
381
+ if print_list_header ("" , "CAN_TD" , canname , cantd_list ):
378
382
print_can (cantd_list )
379
383
if print_list_header ("ETHERNET" , "Ethernet" , "ETH" , eth_list ):
380
384
print_eth ()
@@ -595,14 +599,15 @@ def print_can(lst):
595
599
for p in lst :
596
600
result = get_gpio_af_num (p [1 ], p [2 ])
597
601
s1 = "%-10s" % (" {" + p [0 ] + "," )
598
- # 2nd element is the CAN_XX signal
599
- instance = p [2 ].split ("_" )[0 ].replace ("CAN" , "" )
600
- if len (instance ) == 0 :
601
- instance = "1"
602
+ # 2nd element is the (FD)CAN_XX signal
603
+ instance_name = p [2 ].split ("_" )[0 ]
604
+ instance_number = instance_name .replace ("FD" , "" ).replace ("CAN" , "" )
605
+ if len (instance_number ) == 0 :
606
+ instance_name += "1"
602
607
if "STM32F10" in mcu_file and lst == canrd_list :
603
- s1 += "CAN" + instance + ", STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, "
608
+ s1 += instance_name + ", STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, "
604
609
else :
605
- s1 += "CAN" + instance + ", STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, "
610
+ s1 += instance_name + ", STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, "
606
611
r = result .split (" " )
607
612
for af in r :
608
613
s2 = s1 + af + ")},\n "
0 commit comments