summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-09-13 11:31:45 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-09-13 11:31:45 +0300
commitfd9a79a06db00c6199a5dcaee22ed2cd8e3c3e9b (patch)
treea449ebc08ef2fb8673d88550096ac27e64ca8082 /generator
parent59cba0beeabac991b123dc6826e534f7838c5961 (diff)
parent9ada7e752516260054525fca8e1f67efa321f682 (diff)
Merge branch 'dev_get_rid_of_ternary_operator'
Diffstat (limited to 'generator')
-rwxr-xr-xgenerator/nanopb_generator.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index d70938a1..2e30b676 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -246,10 +246,11 @@ class Field:
'''Return the pb_field_t initializer to use in the constant array.
prev_field_name is the name of the previous field or None.
'''
- result = ' PB_FIELD(%3d, ' % self.tag
+ result = ' PB_FIELD2(%3d, ' % self.tag
result += '%-8s, ' % self.pbtype
result += '%s, ' % self.rules
result += '%s, ' % self.allocation
+ result += '%s, ' % ("FIRST" if not prev_field_name else "OTHER")
result += '%s, ' % self.struct_name
result += '%s, ' % self.name
result += '%s, ' % (prev_field_name or self.name)