Some minor fixes

This commit is contained in:
David
2023-06-11 14:10:16 -05:00
parent 4d668a1ef4
commit f356eb04e1
3 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ def calculate_checksum_for_function(funcLabel, varLabel, funcSizeLabel):
def calculate_matches():
global mapFile, RAM_TO_ROM
REGEX_MAP_GET_LABEL = r"[ ]*?0x[0-9A-Fa-f]{8}([0-9A-Fa-f]{8})[ ]*?([_A-Za-z0-9]+)"
REGEX_MAP_GET_LABEL = r"[ ]*?(?:0x[0-9A-Fa-f]{8})?([0-9A-Fa-f]{8})[ ]*?([_A-Za-z0-9]+)"
mapText = FileUtil.get_text_from_file(MAP_FILEPATH)
mapMatches = getMatches(mapText, REGEX_MAP_GET_LABEL)
for i in range(0, len(mapMatches) - 1):
+5 -2
View File
@@ -205,7 +205,7 @@ class GenerateLD:
def append_files(self, files, extensions, directory, outputDir):
filenames = FileUtil.get_filenames_from_directory_recursive(directory, extensions)
regex = r'[\/][*]+\s*RAM_POS:\s*0x([0-9a-fA-F]+)\s*[*]+[\/]'
regex = r'[\/][*]+\s*RAM_POS:\s*((?:0x)[0-9a-fA-F]+|(?:[Aa][Uu][Tt][Oo]))\s*[*]+[\/]'
for filename in filenames:
with open(directory + '/' + filename, 'r') as inFile:
notDone = True
@@ -216,7 +216,10 @@ class GenerateLD:
line = inFile.readline()
continue
matchedGroups = matches.groups()
files.append((outputDir + filename[:-2] + '.o', '', matchedGroups[0], 0))
ramPos = matchedGroups[0]
if ramPos.lower() == 'auto':
ramPos = '800FFFF0'
files.append((outputDir + filename[:-2] + '.o', '', ramPos, 0))
break
def get_code_files(self):