summaryrefslogtreecommitdiffhomepage
path: root/digital/lcd/src
diff options
context:
space:
mode:
authorNicolas Schodet2013-05-10 22:18:40 +0200
committerNicolas Schodet2013-05-10 22:18:40 +0200
commit89a45501b797c8665205d9836fdbfef5e0a05f85 (patch)
tree31a4ec14882a813b1c5f63a3d0f4660ef2381e20 /digital/lcd/src
parentb9720538f58902644a6b69abacf7005a2412a008 (diff)
digital/lcd/src: accept transient commands as regular commands
Diffstat (limited to 'digital/lcd/src')
-rw-r--r--digital/lcd/src/main.cc8
1 files changed, 3 insertions, 5 deletions
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.