fix message headers

This commit is contained in:
Alex Bates 2021-02-10 00:53:14 +00:00
parent d687f84d35
commit 46d7a144e7
2 changed files with 4 additions and 3 deletions

View File

@ -389,6 +389,7 @@ async def main():
msg_files = []
for d in ASSET_DIRS:
msg_files.extend(glob(d + "/**/*.msg", recursive=True))
msg_files = list(set(msg_files)) # dedup
for msg_file in msg_files:
n.build(
f"$builddir/{msg_file.split('/', 1)[1]}.bin",
@ -397,7 +398,7 @@ async def main():
implicit="tools/msg/parse_compile.py",
)
msg_headers = [add_generated_header(f"$builddir/include/{msg_file.split('/', 1)[1]}.h") for msg_file in msg_files]
msg_bins = list(set([f"$builddir/{msg_file.split('/', 1)[1]}.bin" for msg_file in msg_files]))
msg_bins = [f"$builddir/{msg_file.split('/', 1)[1]}.bin" for msg_file in msg_files]
n.build(
"$builddir/msg.bin",
"msg_combine",

View File

@ -53,7 +53,7 @@ if __name__ == "__main__":
sections.append([])
section = sections[section_idx]
index = message.index if message.index is not None else len(section)
message.index = index = message.index if message.index is not None else len(section)
if message.name:
if message.name in names:
@ -104,7 +104,7 @@ if __name__ == "__main__":
)
for message in messages:
h += f"#define MessageID_{message.name} MESSAGE_ID({message.section}, {message.index})\n"
h += f"#define MSG_{message.name} MESSAGE_ID({message.section}, {message.index})\n"
h += "\n#endif\n"
h_lines = h.splitlines()