Print actual status and data on TWI error
The contents of `TWSR` (TWI Status Register) and `TWDR` (TWI Data Register) are printed when an error occured.
This commit is contained in:
parent
664aa4bad5
commit
2579ae3686
1 changed files with 14 additions and 0 deletions
|
@ -336,6 +336,20 @@ static void lcd_splash(void) {
|
||||||
static void twi_error(void) {
|
static void twi_error(void) {
|
||||||
lcd_fill(0xFF);
|
lcd_fill(0xFF);
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < 2; i++) {
|
||||||
|
lcd_move_cursor(0, i);
|
||||||
|
lcd_write_string_page("TW_STATUS:\0", i, true);
|
||||||
|
lcd_write_kerning(2, true);
|
||||||
|
lcd_write_integer_page(TW_STATUS, 3, i, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < 2; i++) {
|
||||||
|
lcd_move_cursor(0, i + 2);
|
||||||
|
lcd_write_string_page("TW_DATA:\0", i, true);
|
||||||
|
lcd_write_kerning(16, true);
|
||||||
|
lcd_write_integer_page(TWDR, 3, i, true);
|
||||||
|
}
|
||||||
|
|
||||||
for (;;);
|
for (;;);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue