summaryrefslogtreecommitdiffstats
path: root/generator/nanopb_generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'generator/nanopb_generator.py')
-rwxr-xr-xgenerator/nanopb_generator.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index 357350f0..501affa0 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -1119,9 +1119,11 @@ class ProtoFile:
yield '/* Maximum encoded size of messages (where known) */\n'
for msg in self.messages:
msize = msg.encoded_size(self.dependencies)
+ identifier = '%s_size' % msg.name
if msize is not None:
- identifier = '%s_size' % msg.name
yield '#define %-40s %s\n' % (identifier, msize)
+ else:
+ yield '/* %s depends on runtime parameters */\n' % identifier
yield '\n'
yield '/* Message IDs (where set with "msgid" option) */\n'