thermferm/lcd-buffer.c

Sat, 25 Apr 2020 20:31:31 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 25 Apr 2020 20:31:31 +0200
changeset 605
e00f8ff4de9a
parent 484
7362ebd40f26
child 614
389097dc665d
permissions
-rw-r--r--

Version 0.9.8. Added extra path to the fonts for Debian buster. Changed the PID to work on Proportional on Measurement. Added loops so that it looks like the PID is running at 100 mSec intervals.

106
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
420
644a6106d712 The first ideas of the brewpanel simulation are in place.
Michiel Broek <mbroek@mbse.eu>
parents: 418
diff changeset
2 * Copyright (C) 2014-2015
106
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of the mbsePi-apps
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * mbsePi-apps is distributed in the hope that it will be useful, but
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * along with mbsePi-apps; see the file COPYING. If not, write to the Free
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23 #include "thermferm.h"
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 #include "lcd-buffer.h"
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
25 #include "lcd-pcf8574.h"
420
644a6106d712 The first ideas of the brewpanel simulation are in place.
Michiel Broek <mbroek@mbse.eu>
parents: 418
diff changeset
26 #include "slcd.h"
200
a215ddaabbe2 Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
27 #include "panel.h"
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
28
106
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
30 int current_lines = 0;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
31 int current_offset = 0;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
32 lcd_rows *my_lcd_rows = NULL;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
33
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
34 extern int lcdHandle;
420
644a6106d712 The first ideas of the brewpanel simulation are in place.
Michiel Broek <mbroek@mbse.eu>
parents: 418
diff changeset
35 extern int slcdHandle;
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
36 extern sys_config Config;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
37
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
38
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
39
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
40 /*
245
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
41 * Reset the LCD screens chain, it will automatic rebuild.
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
42 */
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
43 void lcd_buf_reset(void)
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
44 {
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
45 lcd_rows *tmp, *old;
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
46
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
47 for (tmp = my_lcd_rows; tmp; tmp = old) {
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
48 old = tmp->next;
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
49 tmp->next = NULL;
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
50 free(tmp);
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
51 }
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
52 current_lines = current_offset = 0;
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
53 my_lcd_rows = NULL;
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
54 }
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
55
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
56
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
57
b01b6238eb67 You can now safely add and remove units on a running system.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
58 /*
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
59 * Write to buffer array. Allocate more lines if needed.
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
60 */
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
61 void lcd_buf_write(int row, const char *format, ...)
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
62 {
222
6519fc50f543 Increased buffersize
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
63 char buf[81 * sizeof(char)];
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
64 va_list va_ptr;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
65 lcd_rows *tmp, *newrow;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
66 int i = 0;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
67
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
68 va_start(va_ptr, format);
214
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
69 vsnprintf(buf, (Config.lcd_cols + 1) * sizeof(char), format, va_ptr);
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
70 va_end(va_ptr);
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
71
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
72 /*
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
73 * Check if the line in row is allocated. If not, do it
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
74 * and make sure the chain is valid.
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
75 */
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
76 while (row > current_lines) {
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
77
231
fafc84ec217e Spelling errwror
Michiel Broek <mbroek@mbse.eu>
parents: 230
diff changeset
78 syslog(LOG_NOTICE, "lcd_buf_write(%d, ...) allocate new row", row);
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
79 newrow = (lcd_rows *)malloc(sizeof(lcd_rows));
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
80 newrow->next = NULL;
213
2317b8d644fa Code cleanup, streamlined error messages.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
81 snprintf(newrow->row, (Config.lcd_cols + 1) * sizeof(char), " ");
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
82
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
83 if (my_lcd_rows == NULL) {
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
84 my_lcd_rows = newrow;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
85 } else {
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
86 for (tmp = my_lcd_rows; tmp; tmp = tmp->next) {
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
87 if (tmp->next == NULL) {
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
88 tmp->next = newrow;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
89 current_lines++;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
90 break;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
91 }
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
92 }
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
93 }
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
94 }
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
95
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
96 /*
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
97 * Now update the text
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
98 */
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
99 for (tmp = my_lcd_rows; tmp; tmp = tmp->next) {
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
100 i++;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
101 if (i == row) {
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
102 snprintf(tmp->row, Config.lcd_cols + 1, "%s", buf);
230
5a7024e6be88 Added logging for wrong LCD buffer allocations
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
103 return;
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
104 }
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
105 }
230
5a7024e6be88 Added logging for wrong LCD buffer allocations
Michiel Broek <mbroek@mbse.eu>
parents: 228
diff changeset
106 syslog(LOG_NOTICE, "lcd_buf_write(%d, ...) could not find row, i=%d", row, i);
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
107 }
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
109
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
110
205
ca18ff45deba Start initial menu setup
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
111 void lcd_buf_step(int key)
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
112 {
204
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
113 if (key == KEY_DOWN) {
200
a215ddaabbe2 Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
114 if (current_offset < (current_lines - Config.lcd_rows))
228
11655e7124c5 Fixed stepping down in LCD screens.
Michiel Broek <mbroek@mbse.eu>
parents: 226
diff changeset
115 current_offset += Config.lcd_rows;
200
a215ddaabbe2 Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
116 else
a215ddaabbe2 Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
117 current_offset = 0;
226
d857032c6201 Added debug log info to lcd_buf functions.
Michiel Broek <mbroek@mbse.eu>
parents: 223
diff changeset
118 syslog(LOG_NOTICE, "lcd_buf_step(KEY_DOWN) current_lines=%d current_offset=%d", current_lines, current_offset);
204
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
119 lcd_buf_show();
200
a215ddaabbe2 Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
120 }
204
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
121 if (key == KEY_UP) {
228
11655e7124c5 Fixed stepping down in LCD screens.
Michiel Broek <mbroek@mbse.eu>
parents: 226
diff changeset
122 if (current_offset >= Config.lcd_rows)
11655e7124c5 Fixed stepping down in LCD screens.
Michiel Broek <mbroek@mbse.eu>
parents: 226
diff changeset
123 current_offset -= Config.lcd_rows;
200
a215ddaabbe2 Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
124 else
a215ddaabbe2 Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
125 current_offset = (current_lines - Config.lcd_rows);
226
d857032c6201 Added debug log info to lcd_buf functions.
Michiel Broek <mbroek@mbse.eu>
parents: 223
diff changeset
126 syslog(LOG_NOTICE, "lcd_buf_step(KEY_UP) current_lines=%d current_offset=%d", current_lines, current_offset);
204
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
127 lcd_buf_show();
200
a215ddaabbe2 Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
128 }
204
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
129 }
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
130
200
a215ddaabbe2 Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
131
a215ddaabbe2 Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
132
204
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
133 /*
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
134 * This will be called from the main thread every second.
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
135 */
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
136 void lcd_buf_show(void)
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
137 {
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
138 int i = 0, r = 0;
9a14d6b2de7f Fixed LCD display updates. Better key routines.
Michiel Broek <mbroek@mbse.eu>
parents: 200
diff changeset
139 lcd_rows *tmp;
200
a215ddaabbe2 Added first panel key routines. The LCD display steps manual only and has a 2 minutes backlight timeout.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
140
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
141 for (tmp = my_lcd_rows; tmp; tmp = tmp->next) {
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
142 if (i == current_offset)
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
143 break;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
144 i++;
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
145 }
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
146
226
d857032c6201 Added debug log info to lcd_buf functions.
Michiel Broek <mbroek@mbse.eu>
parents: 223
diff changeset
147 if (tmp == NULL) {
d857032c6201 Added debug log info to lcd_buf functions.
Michiel Broek <mbroek@mbse.eu>
parents: 223
diff changeset
148 syslog(LOG_NOTICE, "lcd_buf_show: search after last record, current_offset=%d current_lines=%d i=%d", current_offset, current_lines, i);
d857032c6201 Added debug log info to lcd_buf functions.
Michiel Broek <mbroek@mbse.eu>
parents: 223
diff changeset
149 return;
d857032c6201 Added debug log info to lcd_buf functions.
Michiel Broek <mbroek@mbse.eu>
parents: 223
diff changeset
150 }
d857032c6201 Added debug log info to lcd_buf functions.
Michiel Broek <mbroek@mbse.eu>
parents: 223
diff changeset
151
422
13502d0dda65 The brewpanel works, but still needs a lot more
Michiel Broek <mbroek@mbse.eu>
parents: 420
diff changeset
152 for (r = 0; r < Config.lcd_rows; r++) {
418
0bfe08c7ba6e Reenabled code round LCD driver.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
153 #ifdef HAVE_WIRINGPI_H
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
154 lcdPosition(lcdHandle, 0, r);
223
14700edd2a67 Removed LCD shadow copy buffer.
Michiel Broek <mbroek@mbse.eu>
parents: 222
diff changeset
155 lcdPuts(lcdHandle, tmp->row);
418
0bfe08c7ba6e Reenabled code round LCD driver.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
156 #endif
420
644a6106d712 The first ideas of the brewpanel simulation are in place.
Michiel Broek <mbroek@mbse.eu>
parents: 418
diff changeset
157 slcdPosition(slcdHandle, 0, r);
644a6106d712 The first ideas of the brewpanel simulation are in place.
Michiel Broek <mbroek@mbse.eu>
parents: 418
diff changeset
158 slcdPuts(slcdHandle, tmp->row);
422
13502d0dda65 The brewpanel works, but still needs a lot more
Michiel Broek <mbroek@mbse.eu>
parents: 420
diff changeset
159
13502d0dda65 The brewpanel works, but still needs a lot more
Michiel Broek <mbroek@mbse.eu>
parents: 420
diff changeset
160 if (tmp->next != NULL)
13502d0dda65 The brewpanel works, but still needs a lot more
Michiel Broek <mbroek@mbse.eu>
parents: 420
diff changeset
161 tmp = tmp->next;
13502d0dda65 The brewpanel works, but still needs a lot more
Michiel Broek <mbroek@mbse.eu>
parents: 420
diff changeset
162 else
13502d0dda65 The brewpanel works, but still needs a lot more
Michiel Broek <mbroek@mbse.eu>
parents: 420
diff changeset
163 tmp = my_lcd_rows;
108
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
164 }
50d2187fdb74 New rotating LCD display
Michiel Broek <mbroek@mbse.eu>
parents: 106
diff changeset
165 }
106
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166
1bd9a16f5061 Added .h files
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167

mercurial