thermferm/lcd-pcf8574.c

changeset 213
2317b8d644fa
parent 106
1bd9a16f5061
child 223
14700edd2a67
equal deleted inserted replaced
212:a76cbe676bf1 213:2317b8d644fa
37 int bits, rows, cols ; 37 int bits, rows, cols ;
38 int rsPin, strbPin ; 38 int rsPin, strbPin ;
39 int dataPins [8] ; 39 int dataPins [8] ;
40 int cx, cy ; 40 int cx, cy ;
41 }; 41 };
42
42 extern struct lcdDataStruct *lcds [MAX_LCDS]; 43 extern struct lcdDataStruct *lcds [MAX_LCDS];
44 extern sys_config Config;
45
43 46
44 47
45 /* 48 /*
46 * Some LCD functions are extended shadow copies of the wiringPi functions. 49 * Some LCD functions are extended shadow copies of the wiringPi functions.
47 * The difference is that the lcdbuf will be updated with the contents on 50 * The difference is that the lcdbuf will be updated with the contents on
93 fprintf (stderr, "lcdInit failed\n") ; 96 fprintf (stderr, "lcdInit failed\n") ;
94 return -1 ; 97 return -1 ;
95 } 98 }
96 99
97 lcdClear (lcdHandle) ; 100 lcdClear (lcdHandle) ;
98 for (x = 0; x < 20; x++) 101 for (x = 0; x < Config.lcd_cols; x++)
99 for (y = 0; y < 4; y++) 102 for (y = 0; y < Config.lcd_rows; y++)
100 lcdbuf[lcdHandle][x][y] = ' '; 103 lcdbuf[lcdHandle][x][y] = ' ';
101 104
102 setBacklight (1) ; 105 setBacklight (1) ;
103 106
104 return 0 ; 107 return 0 ;
131 void mb_lcdClear(const int fd) 134 void mb_lcdClear(const int fd)
132 { 135 {
133 int x, y; 136 int x, y;
134 137
135 lcdClear(fd); 138 lcdClear(fd);
136 for (x = 0; x < 20; x++) 139 for (x = 0; x < Config.lcd_cols; x++)
137 for (y = 0; y < 4; y++) 140 for (y = 0; y < Config.lcd_rows; y++)
138 lcdbuf[fd][x][y] = ' '; 141 lcdbuf[fd][x][y] = ' ';
139 } 142 }
140 143
141 144
142 145

mercurial