summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-02-13 18:14:25 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-02-13 18:14:25 +0100
commit34e6e0c40457afe9978530500d219245e6d801e4 (patch)
tree5613403bbf1bc777b5a08d0ba54e53fcb632b798
parent5e446dc9a5ed2d851fcae108e4f52f0b922b7989 (diff)
fix receive for all transmission lengths.
it was working fine all along, the demo display code just didn't like the double trailing null bytes. It's still not 100% fine (the first byte is overwritten with a 0 byte for uneven string lengths), but since it's just demo code that's acceptable for now
-rw-r--r--src/system.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/system.cc b/src/system.cc
index 1a0522d..537f0b9 100644
--- a/src/system.cc
+++ b/src/system.cc
@@ -67,9 +67,11 @@ void System::loop()
if (i == 127) {
i = 0;
} else if (modem_byte == 0) {
- ohai.data = disp_buf;
- ohai.length = i-1;
- display.show(&ohai);
+ if (i > 1) { // workaround for trailing double null bytes
+ ohai.data = disp_buf;
+ ohai.length = i-1;
+ display.show(&ohai);
+ }
i = 0;
}
}