From 89a45501b797c8665205d9836fdbfef5e0a05f85 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 10 May 2013 22:18:40 +0200 Subject: digital/lcd/src: accept transient commands as regular commands --- digital/lcd/src/main.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'digital/lcd') diff --git a/digital/lcd/src/main.cc b/digital/lcd/src/main.cc index d93783ce..597fdf09 100644 --- a/digital/lcd/src/main.cc +++ b/digital/lcd/src/main.cc @@ -62,10 +62,7 @@ i2c_handle (LCD &lcd, const char *buf, int size) if (ucoo::crc8_compute ((const uint8_t *) buf + 1, size - 1) != buf[0]) return; // Handle sequence number. - if (buf[1] == 0) - // Transient command, not handled for the moment. - return; - if (buf[1] == i2c_seq) + if (buf[1] != 0 && buf[1] == i2c_seq) // Duplicated command. return; // OK, now handle command. @@ -129,7 +126,8 @@ i2c_handle (LCD &lcd, const char *buf, int size) } i2c_received = true; // Acknowledge. - i2c_seq = buf[1]; + if (buf[1] != 0) + i2c_seq = buf[1]; } /// Poll I2C interface for commands and update status. -- cgit v1.2.3