summaryrefslogtreecommitdiff
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-rw-r--r--host/inter/inter_node.py2
-rw-r--r--host/proto/proto.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/host/inter/inter_node.py b/host/inter/inter_node.py
index b744cade..66eb5b2f 100644
--- a/host/inter/inter_node.py
+++ b/host/inter/inter_node.py
@@ -171,7 +171,7 @@ class InterNode (Inter):
v = 0.000571429 * d*d + -0.0752381 * d + 2.89107
else:
v = 2.2 / 10 * d
- v *= 1024 / 5
+ v = int (round (v * 1024 / 5))
assert v >= 0 and v < 1024
adc.value = v
adc.notify ()
diff --git a/host/proto/proto.py b/host/proto/proto.py
index 0e56565a..e5f0af21 100644
--- a/host/proto/proto.py
+++ b/host/proto/proto.py
@@ -158,7 +158,7 @@ class Frame:
if command:
assert len (command) == 1 and command.isalpha ()
self.command = command
- self.args = struct.pack ('!' + fmt, *[ int (i) for i in args ])
+ self.args = struct.pack ('!' + fmt, *args)
else:
self.command = None
self.args = ''