aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-11-18 10:54:47 -0500
committerKevin O'Connor <kevin@koconnor.net>2018-11-18 11:00:37 -0500
commit76f07979bbed5d4b05bb4ba22733c4a676a19d72 (patch)
tree561bebabda75199a11ba0b2bc978768a6faae9f2
parent150cae1d1f20088823d7d5742b0d9368ae18fc7b (diff)
downloadkutter-76f07979bbed5d4b05bb4ba22733c4a676a19d72.tar.gz
kutter-76f07979bbed5d4b05bb4ba22733c4a676a19d72.tar.xz
kutter-76f07979bbed5d4b05bb4ba22733c4a676a19d72.zip
buildcommands: Make sure to not use 96 or more message ids
The mcu code assumes the encoder and parser id is always one byte. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--scripts/buildcommands.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/buildcommands.py b/scripts/buildcommands.py
index 09ecad70..97f1513a 100644
--- a/scripts/buildcommands.py
+++ b/scripts/buildcommands.py
@@ -168,6 +168,9 @@ class HandleCommandGeneration:
if msg not in self.msg_to_id:
msgid += 1
self.msg_to_id[msg] = msgid
+ if msgid >= 96:
+ # The mcu currently assumes all message ids encode to one byte
+ error("Too many message ids")
def update_data_dictionary(self, data):
messages = { msgid: msg for msg, msgid in self.msg_to_id.items() }
data['messages'] = messages