summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/lcd-player.c27
-rw-r--r--firmware/drivers/lcd.h1
2 files changed, 20 insertions, 8 deletions
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c
index a03b1b0..bac18d2 100644
--- a/firmware/drivers/lcd-player.c
+++ b/firmware/drivers/lcd-player.c
@@ -315,14 +315,25 @@ void lcd_puts(int x, int y, unsigned char *string)
void lcd_put_cursor(int x, int y, char cursor_char)
{
- cursor.text[0]=buffer_xlcd[x][y];
- cursor.text[1]=cursor_char;
- cursor.len=2;
- cursor.textpos=0;
- cursor.y_pos=y;
- cursor.x_pos=x;
- cursor.downcount=0;
- cursor.divider=4;
+ if (cursor.len==0) {
+ cursor.text[0]=buffer_xlcd[x][y];
+ cursor.text[1]=cursor_char;
+ cursor.len=2;
+ cursor.textpos=0;
+ cursor.y_pos=y;
+ cursor.x_pos=x;
+ cursor.downcount=0;
+ cursor.divider=4;
+ }
+}
+
+void lcd_remove_cursor(void)
+{
+ if (cursor.len!=0) {
+ cursor.len=0;
+ if (lcdx_putc(cursor.x_pos, cursor.y_pos, cursor.text[0]))
+ lcd_update();
+ }
}
void lcd_putc(int x, int y, unsigned short ch)
diff --git a/firmware/drivers/lcd.h b/firmware/drivers/lcd.h
index b4623c2..6149dc3 100644
--- a/firmware/drivers/lcd.h
+++ b/firmware/drivers/lcd.h
@@ -86,6 +86,7 @@ void lcd_unlock_pattern(unsigned char pat);
void lcd_allow_bidirectional_scrolling(bool on);
extern void lcd_bidir_scroll(int threshold);
void lcd_put_cursor(int x, int y, char cursor_char);
+void lcd_remove_cursor(void);
#endif
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)