From 4b3ada594b2bd923d0a3b621197ebf199bb4b25a Mon Sep 17 00:00:00 2001 From: Silver Kits Date: Tue, 4 Oct 2016 22:03:41 +0300 Subject: [PATCH] Add function to clear screen only starting from given position to given length --- lib/hd44780_111/hd44780.c | 14 ++++++++++++++ lib/hd44780_111/hd44780.h | 1 + 2 files changed, 15 insertions(+) diff --git a/lib/hd44780_111/hd44780.c b/lib/hd44780_111/hd44780.c index d00deae..0e1dda7 100755 --- a/lib/hd44780_111/hd44780.c +++ b/lib/hd44780_111/hd44780.c @@ -722,3 +722,17 @@ void lcd_use_display(int ADisplay) } #endif + +/************************************************************************* +Clear characters at position until length +Input: start position and lentgh +Returns: none +*************************************************************************/ +void lcd_clr(uint8_t pos, uint8_t len) + { + for (int i = 0; i < len; i++) { + lcd_goto(pos + i); + lcd_putc(' '); + } + } + diff --git a/lib/hd44780_111/hd44780.h b/lib/hd44780_111/hd44780.h index 19b47de..f486b43 100755 --- a/lib/hd44780_111/hd44780.h +++ b/lib/hd44780_111/hd44780.h @@ -49,6 +49,7 @@ void lcd_init(); void lcd_command(uint8_t cmd); void lcd_clrscr(); +void lcd_clr(uint8_t pos, uint8_t len); void lcd_home(); void lcd_goto(uint8_t pos);