From 8d7471d3a442d3ee94f008c7bf3b254728f70ea9 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Sat, 28 May 2016 14:40:32 +0200 Subject: [PATCH] Display: display_clear() is a common command now. Before control commands were queued up, this was different for each display. --- display.c | 8 ++++++++ display_hd44780.c | 7 ------- display_ssd1306.c | 8 -------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/display.c b/display.c index f757b16..96564dc 100644 --- a/display.c +++ b/display.c @@ -29,6 +29,14 @@ volatile uint8_t displaybuf[BUFSIZE]; #include "delay.h" +/** + Queue up a clear screen command. Very cheap operation on some displays, like + the HD44780, rather expensive on others, like the SSD1306. +*/ +void display_clear(void) { + display_writechar((uint8_t)low_code_clear); +} + /** Prints a character at the current cursor position. diff --git a/display_hd44780.c b/display_hd44780.c index 04af318..566259d 100644 --- a/display_hd44780.c +++ b/display_hd44780.c @@ -37,13 +37,6 @@ void display_init(void) { displaybus_write(0x0C, parallel_4bit_instruction); } -/** - Queue up a clear screen command. Cheap operation on this display. -*/ -void display_clear(void) { - display_writechar((uint8_t)low_code_clear); -} - /** Sets the cursor to the given position. diff --git a/display_ssd1306.c b/display_ssd1306.c index adbef79..ffa7716 100644 --- a/display_ssd1306.c +++ b/display_ssd1306.c @@ -114,14 +114,6 @@ void display_init(void) { } } -/** - Queue up a clear screen command. Be careful, this is an expensive operation - on this display. -*/ -void display_clear(void) { - display_writechar((uint8_t)low_code_clear); -} - /** Sets the cursor to the given position.