@@ -149,17 +149,6 @@ def update_file(filePath, compile_pattern, subs):
149
149
file .write (fileContents )
150
150
151
151
152
- # get xml family
153
- def get_mcu_family (mcu_file ):
154
- xml_mcu = parse (str (mcu_file ))
155
- mcu_node = xml_mcu .getElementsByTagName ("Mcu" )[0 ]
156
- mcu_family = mcu_node .attributes ["Family" ].value
157
- if mcu_family .endswith ("+" ):
158
- mcu_family = mcu_family [:- 1 ]
159
- xml_mcu .unlink ()
160
- return mcu_family
161
-
162
-
163
152
# mcu file parsing
164
153
def parse_mcu_file ():
165
154
global gpiofile
@@ -908,9 +897,11 @@ def can_pinmap(lst):
908
897
)
909
898
return dict (
910
899
name = name ,
911
- hal = ["CAN" , "CAN_LEGACY" ]
912
- if name != "FDCAN" and any (mcu in mcu_family for mcu in legacy_hal ["CAN" ])
913
- else name ,
900
+ hal = (
901
+ ["CAN" , "CAN_LEGACY" ]
902
+ if name != "FDCAN" and any (mcu in mcu_family for mcu in legacy_hal ["CAN" ])
903
+ else name
904
+ ),
914
905
aname = aname ,
915
906
data = "" ,
916
907
wpin = max (wpin ) + 1 ,
@@ -939,9 +930,11 @@ def eth_pinmap():
939
930
)
940
931
return dict (
941
932
name = "ETHERNET" ,
942
- hal = ["ETH" , "ETH_LEGACY" ]
943
- if any (mcu in mcu_family for mcu in legacy_hal ["ETH" ])
944
- else "ETH" ,
933
+ hal = (
934
+ ["ETH" , "ETH_LEGACY" ]
935
+ if any (mcu in mcu_family for mcu in legacy_hal ["ETH" ])
936
+ else "ETH"
937
+ ),
945
938
aname = "Ethernet" ,
946
939
data = "" ,
947
940
wpin = max (wpin ) + 1 ,
@@ -2501,7 +2494,6 @@ def manage_repo():
2501
2494
templates_dir = script_path / "templates"
2502
2495
mcu_family_dir = ""
2503
2496
filtered_family = ""
2504
- # filtered_mcu_file = ""
2505
2497
periph_c_filename = "PeripheralPins.c"
2506
2498
pinvar_h_filename = "PinNamesVar.h"
2507
2499
config_filename = script_path / "variant_config.json"
@@ -2553,18 +2545,6 @@ def manage_repo():
2553
2545
help = "list available xml files description in database" ,
2554
2546
action = "store_true" ,
2555
2547
)
2556
- # group.add_argument(
2557
- # "-m",
2558
- # "--mcu",
2559
- # metavar="xml",
2560
- # help=textwrap.dedent(
2561
- # """\
2562
- # Generate all files for specified mcu xml file description in database.
2563
- # This xml file can contain non alpha characters in its name,
2564
- # you should call it with double quotes.
2565
- # """
2566
- # ),
2567
- # )
2568
2548
2569
2549
group .add_argument (
2570
2550
"-f" ,
@@ -2627,16 +2607,6 @@ def manage_repo():
2627
2607
db_release = release_match .group (1 )
2628
2608
print (f"CubeMX DB release { db_release } \n " )
2629
2609
2630
- # if args.mcu:
2631
- # # Check input file exists
2632
- # if not ((dirMCU / args.mcu).is_file()):
2633
- # print("\n" + args.mcu + " file not found")
2634
- # print("\nCheck in " + dirMCU + " the correct name of this file")
2635
- # print("\nYou may use double quotes for file containing special characters")
2636
- # quit()
2637
- # # Get the family of the desired mcu file
2638
- # filtered_mcu_file = dirMCU / args.mcu
2639
- # filtered_family = get_mcu_family(filtered_mcu_file)
2640
2610
if args .family :
2641
2611
filtered_family = args .family .upper ()
2642
2612
# Get all xml files
0 commit comments