Skip to content

Commit

Permalink
Added explanation as a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudh-seela-ai authored Nov 28, 2023
1 parent c54a9bf commit 3199bbe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions generator/nanopb_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ def __init__(self, names, desc, enum_options, element_path, comments):
self.names = names

# by definition, `names` include this enum's name
# This truncation to only take the last part of the enum name is to allow npb structs to be exported as external C types in Simulink, which have a character restriction limit.
# However, in some cases like in the osi_lane proto, the truncated enum members could be identical across different enums causing symbol clash issues.
# As such, we handle those cases like below explicitly to avoid symbol clashing by renaming these members slightly.
base_name = Names(names.parts[-1])
if str(Names(names.parts[:-1])) == "osi3_Lane_Classification":
base_name = "LCT_"
Expand Down

0 comments on commit 3199bbe

Please sign in to comment.