From: Akos Kiss Date: Thu, 8 Oct 2020 23:42:15 +0000 (+0200) Subject: Fix Clear Screen implementation of HD44780 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=3e33b6fabf7b34f126e48a3dd54909cac1699cd6;p=sx%2Fsimavr.git 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. --- 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); }