From 3e33b6fabf7b34f126e48a3dd54909cac1699cd6 Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Fri, 9 Oct 2020 01:42:15 +0200 Subject: [PATCH] Fix Clear Screen implementation of HD44780 Datasheet mandates filling DDRAM with spaces, setting address counter to DDRAM address 0, and setting entry mode I/D to 1 (increment mode). The "filling with spaces" was implemented but the rest was missing. Now added. --- examples/parts/hd44780.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/parts/hd44780.c b/examples/parts/hd44780.c index 0be074f..a2d0177 100644 --- a/examples/parts/hd44780.c +++ b/examples/parts/hd44780.c @@ -56,6 +56,8 @@ _hd44780_clear_screen( hd44780_t *b) { memset(b->vram, ' ', 0x80); + b->cursor = 0; + hd44780_set_flag(b, HD44780_FLAG_I_D, 2); hd44780_set_flag(b, HD44780_FLAG_DIRTY, 1); avr_raise_irq(b->irq + IRQ_HD44780_ADDR, b->cursor); } -- 2.39.5