brewco/prompt.c

changeset 458
43a8ecb53637
parent 451
2247970de278
child 459
1f88be70f253
equal deleted inserted replaced
457:24a34b7a693d 458:43a8ecb53637
30 extern int lcdHandle; 30 extern int lcdHandle;
31 extern int slcdHandle; 31 extern int slcdHandle;
32 32
33 33
34 34
35 void prompt(int index, char *text) 35 void prompt(int idx, char *text)
36 { 36 {
37 char message[81]; 37 char message[81];
38 int line; 38 int line;
39 39
40 switch (index) { 40 switch (idx) {
41 case 0: 41 case 0:
42 #ifdef HAVE_WIRINGPI_H 42 #ifdef HAVE_WIRINGPI_H
43 piLock(LOCK_LCD); 43 piLock(LOCK_LCD);
44 lcdClear(lcdHandle); 44 lcdClear(lcdHandle);
45 #endif 45 #endif
172 break; 172 break;
173 // 12345678901234567890 173 // 12345678901234567890
174 default: snprintf(message, Config.lcd_cols + 1, " N/A N/A"); 174 default: snprintf(message, Config.lcd_cols + 1, " N/A N/A");
175 } 175 }
176 176
177 if (index < 200) 177 if (idx < 200)
178 line = 0; 178 line = 0;
179 else if (index < 300) 179 else if (idx < 300)
180 line = 1; 180 line = 1;
181 else if (index < 400) 181 else if (idx < 400)
182 line = 2; 182 line = 2;
183 else 183 else
184 line = 3; 184 line = 3;
185 185
186 fprintf(stdout, "%d %d '%s'\n", line, Config.lcd_cols, message); 186 fprintf(stdout, "%d %d '%s'\n", line, Config.lcd_cols, message);

mercurial