thermferm/lcd-buffer.c

changeset 245
b01b6238eb67
parent 231
fafc84ec217e
child 418
0bfe08c7ba6e
--- a/thermferm/lcd-buffer.c	Sat Aug 16 17:11:09 2014 +0200
+++ b/thermferm/lcd-buffer.c	Mon Aug 18 15:10:09 2014 +0200
@@ -38,6 +38,24 @@
 
 
 /*
+ * Reset the LCD screens chain, it will automatic rebuild.
+ */
+void lcd_buf_reset(void)
+{
+    lcd_rows	*tmp, *old;
+
+    for (tmp = my_lcd_rows; tmp; tmp = old) {
+	old = tmp->next;
+	tmp->next = NULL;
+	free(tmp);
+    }
+    current_lines = current_offset = 0;
+    my_lcd_rows = NULL;
+}
+
+
+
+/*
  * Write to buffer array. Allocate more lines if needed.
  */
 void lcd_buf_write(int row, const char *format, ...)

mercurial