display_ssd1306.c: note a possible error recovery strategy.

Currently not implemented because this costs additional binary
size and, well, with I2C being reliable now, it's difficult to
test it. And also because I'm lazy :-)
This commit is contained in:
Markus Hitter 2016-04-27 00:04:26 +02:00
parent d803883cdb
commit f091b1e316
1 changed files with 9 additions and 0 deletions

View File

@ -125,6 +125,15 @@ void display_tick() {
return; return;
} }
/**
Possible strategy for error recovery: after a failed, aborted I2C
transmisson, 'i2c_state & I2C_INTERRUPTED' in i2c.c evaluates to true.
Having a getter like displaybus_failed() would allow to test this condition
here, so we could resend the previous data again, instead of grabbing a
new byte from the buffer.
*/
if (buf_canread(display)) { if (buf_canread(display)) {
buf_pop(display, data); buf_pop(display, data);
index = data - 0x20; index = data - 0x20;