From 34e6e0c40457afe9978530500d219245e6d801e4 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 13 Feb 2016 18:14:25 +0100 Subject: 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 --- src/system.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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; } } -- cgit v1.2.3