summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-03-13 15:22:00 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-03-13 15:22:00 +0200
commit1396dce2aeeaea9f15ca5f495718bc85aeda8bd8 (patch)
tree696cb3a6fa98c16bb7c998f2101bb290f7aba1b5 /generator
parent6468f23d231343f1e08007621b8f3d566f0ec3ac (diff)
Add support for packed structures on IAR and MSVC.
Update issue 66 Status: FixedInGit
Diffstat (limited to 'generator')
-rw-r--r--generator/nanopb_generator.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index ddfc45b5..5ef4ab7a 100644
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -312,6 +312,11 @@ class Message:
result += ' pb_packed'
result += ' %s;' % self.name
+
+ if self.packed:
+ result = 'PB_PACKED_STRUCT_START\n' + result
+ result += '\nPB_PACKED_STRUCT_END'
+
return result
def types(self):