83
83
MCU_USERNAME = ""
84
84
TIM_MST = ""
85
85
ALTERNATE_DEFINITION = 0
86
+ TARGET_NAME = ""
86
87
87
88
TIM_DUALCORE_LIST = { # Timer used for us ticker is hardcoded in this script
88
89
"H745" :"TIM2" ,
@@ -461,7 +462,7 @@ def print_header():
461
462
#ifdef __cplusplus
462
463
extern "C" {
463
464
#endif
464
- """ % (date_year , os .path .basename (input_file_name ), TargetName ))
465
+ """ % (date_year , os .path .basename (input_file_name ), TARGET_NAME ))
465
466
out_h_file .write (line_to_write )
466
467
467
468
if DUAL_PAD :
@@ -1689,21 +1690,20 @@ def parse_board_file(file_name):
1689
1690
sys .exit (0 )
1690
1691
1691
1692
parse_board_file (board_file_name )
1692
- TargetName = ""
1693
1693
if "Nucleo" in board_file_name :
1694
- TargetName += "NUCLEO_"
1694
+ TARGET_NAME += "NUCLEO_"
1695
1695
elif "Discovery" in board_file_name :
1696
- TargetName += "DISCO_"
1696
+ TARGET_NAME += "DISCO_"
1697
1697
elif "Evaluation" in board_file_name :
1698
- TargetName += "EVAL_"
1698
+ TARGET_NAME += "EVAL_"
1699
1699
m = re .search (r'STM32([MFLGWH][\w]*)_Board' , board_file_name )
1700
1700
if m :
1701
- TargetName += "%s" % m .group (1 )
1701
+ TARGET_NAME += "%s" % m .group (1 )
1702
1702
# specific case
1703
1703
if "-P" in board_file_name :
1704
- TargetName += "_P"
1704
+ TARGET_NAME += "_P"
1705
1705
elif "-Q" in board_file_name :
1706
- TargetName += "_Q"
1706
+ TARGET_NAME += "_Q"
1707
1707
1708
1708
target_rename = { # manual renaming for some boards
1709
1709
"DISCO_L072C" : "DISCO_L072CZ_LRWAN1" ,
@@ -1724,19 +1724,18 @@ def parse_board_file(file_name):
1724
1724
"DISCO_H747XIH" : "DISCO_H747I"
1725
1725
}
1726
1726
1727
- if TargetName in target_rename :
1728
- TargetName = target_rename [TargetName ]
1727
+ if TARGET_NAME in target_rename :
1728
+ TARGET_NAME = target_rename [TARGET_NAME ]
1729
1729
1730
1730
if "DISC1" in board_file_name :
1731
- TargetName += "_DISC1"
1731
+ TARGET_NAME += "_DISC1"
1732
1732
1733
1733
else :
1734
1734
sys .exit (1 )
1735
1735
1736
1736
# Parse the user's custom board .ioc file
1737
1737
if args .custom :
1738
1738
parse_board_file (args .custom )
1739
- TargetName = ""
1740
1739
1741
1740
for mcu_file in mcu_list :
1742
1741
TargetNameList = []
@@ -1823,9 +1822,9 @@ def parse_board_file(file_name):
1823
1822
else :
1824
1823
if EachTargetName == MCU_USERNAME :
1825
1824
if FLAT_DIRECTORY == 0 :
1826
- out_path = os .path .join (cur_dir , 'targets_custom' , 'TARGET_STM' , 'TARGET_%s' % TARGET_FAMILY , 'TARGET_%s' % TARGET_SUBFAMILY , 'TARGET_%s' % TargetName )
1825
+ out_path = os .path .join (cur_dir , 'targets_custom' , 'TARGET_STM' , 'TARGET_%s' % TARGET_FAMILY , 'TARGET_%s' % TARGET_SUBFAMILY , 'TARGET_%s' % TARGET_NAME )
1827
1826
else :
1828
- out_path = os .path .join (cur_dir , 'targets_custom' , 'TARGET_STM' , 'TARGET_%s' % TargetName )
1827
+ out_path = os .path .join (cur_dir , 'targets_custom' , 'TARGET_STM' , 'TARGET_%s' % TARGET_NAME )
1829
1828
else :
1830
1829
continue
1831
1830
0 commit comments