From 6f462a32920aa215a20b6512223e33df257d9f3a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 28 Oct 2013 22:11:14 +0200 Subject: [PATCH] Respond to a zero-length packet with another zero-length packet This could be useful for sync recovery --- arducontrol/interface.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arducontrol/interface.c b/arducontrol/interface.c index 675770f..1cc4b15 100644 --- a/arducontrol/interface.c +++ b/arducontrol/interface.c @@ -24,9 +24,11 @@ void interface_check(void) { uint8_t length = ~serial_read(); - if(length>=0x10) + if(length==0) + serial_write(0xFF); + else if(length>=0x10) interface_send1(FRAMING_ERROR); - else if(length>0) + else { uint8_t cmd[15]; uint8_t i; -- 2.45.2