# HG changeset patch # User Michiel Broek # Date 1407841790 -7200 # Node ID 14700edd2a67239a5a5958a93ee343ef4f923f6f # Parent 6519fc50f54350cd5822a6400a222f5b25e1e49c Removed LCD shadow copy buffer. diff -r 6519fc50f543 -r 14700edd2a67 thermferm/lcd-buffer.c --- a/thermferm/lcd-buffer.c Tue Aug 12 12:49:26 2014 +0200 +++ b/thermferm/lcd-buffer.c Tue Aug 12 13:09:50 2014 +0200 @@ -123,7 +123,7 @@ } lcdPosition(lcdHandle, 0, r); - mb_lcdPuts(lcdHandle, tmp->row); + lcdPuts(lcdHandle, tmp->row); r++; if (r < Config.lcd_rows) { @@ -132,7 +132,7 @@ else tmp = my_lcd_rows; lcdPosition(lcdHandle, 0, r); - mb_lcdPuts(lcdHandle, tmp->row); + lcdPuts(lcdHandle, tmp->row); } } diff -r 6519fc50f543 -r 14700edd2a67 thermferm/lcd-pcf8574.c --- a/thermferm/lcd-pcf8574.c Tue Aug 12 12:49:26 2014 +0200 +++ b/thermferm/lcd-pcf8574.c Tue Aug 12 13:09:50 2014 +0200 @@ -30,7 +30,6 @@ #ifdef HAVE_WIRINGPI_H int lcdHandle; -unsigned char lcdbuf[MAX_LCDS][21][4]; struct lcdDataStruct { @@ -46,13 +45,6 @@ /* - * Some LCD functions are extended shadow copies of the wiringPi functions. - * The difference is that the lcdbuf will be updated with the contents on - * the hardware display. This copy can then be used for a remote display - */ - - -/* * setBacklight: ********************************************************************************* */ @@ -72,8 +64,6 @@ int initLCD (int cols, int rows) { - int x, y; - if (!((rows == 1) || (rows == 2) || (rows == 4))) { fprintf (stderr, "rows must be 1, 2 or 4\n") ; return EXIT_FAILURE ; @@ -98,50 +88,10 @@ } lcdClear (lcdHandle) ; - for (x = 0; x < Config.lcd_cols; x++) - for (y = 0; y < Config.lcd_rows; y++) - lcdbuf[lcdHandle][x][y] = ' '; - setBacklight (1) ; return 0 ; } - -void mb_lcdPutchar(const int fd, unsigned char data) -{ - struct lcdDataStruct *lcd = lcds[fd]; - - /* - * Write to our buffer first, then to the wiringPi driver. - * Writing to wiringPi updates the cursor position. - */ - lcdbuf[fd][lcd->cx][lcd->cy] = data; - lcdPutchar(fd, data); -} - - - -void mb_lcdPuts(const int fd, const char *string) -{ - while (*string) - mb_lcdPutchar (fd, *string++); -} - - - -void mb_lcdClear(const int fd) -{ - int x, y; - - lcdClear(fd); - for (x = 0; x < Config.lcd_cols; x++) - for (y = 0; y < Config.lcd_rows; y++) - lcdbuf[fd][x][y] = ' '; -} - - - #endif - diff -r 6519fc50f543 -r 14700edd2a67 thermferm/lcd-pcf8574.h --- a/thermferm/lcd-pcf8574.h Tue Aug 12 12:49:26 2014 +0200 +++ b/thermferm/lcd-pcf8574.h Tue Aug 12 13:09:50 2014 +0200 @@ -18,9 +18,6 @@ void setBacklight (int); int initLCD (int, int); -void mb_lcdPutchar(const int, unsigned char); -void mb_lcdPuts(const int, const char *); -void mb_lcdClear(const int); #endif diff -r 6519fc50f543 -r 14700edd2a67 thermferm/server.c --- a/thermferm/server.c Tue Aug 12 12:49:26 2014 +0200 +++ b/thermferm/server.c Tue Aug 12 13:09:50 2014 +0200 @@ -30,10 +30,6 @@ extern int my_shutdown; extern int debug; -#ifdef HAVE_WIRINGPI_H -extern int lcdHandle; -extern unsigned char lcdbuf[MAX_LCDS][20][4]; -#endif extern sys_config Config; extern const char UNITMODE[5][8]; extern const char UNITmode[5]; @@ -1332,10 +1328,6 @@ char buf[SS_BUFSIZE]; int i, rlen; socklen_t fromlen; -#ifdef HAVE_WIRINGPI_H - int j; - char obuf[SS_BUFSIZE]; -#endif memset((char *)&buf, 0, SS_BUFSIZE); fromlen = sizeof(peeraddr_in); @@ -1382,7 +1374,6 @@ srv_send((char *)"DEVICE PUT uuid Put Device record by uuid"); srv_send((char *)"GLOBAL GET Get global settings"); srv_send((char *)"GLOBAL PUT Put global settings"); - srv_send((char *)"LCD Get LCD screen (allways 4 rows of 20 characters)"); srv_send((char *)"LIST List all fermenter units"); srv_send((char *)"LIST LOG uuid List logfile data in 1 hour lines"); srv_send((char *)"PROFILE uuid,name Profile rename"); @@ -1399,20 +1390,6 @@ srv_send((char *)"UNIT GET uuid Get Unit record by uuid"); srv_send((char *)"UNIT PUT uuid Put Unit record by uuid"); srv_send((char *)"."); - } else if (strncmp(buf, "LCD", 3) == 0) { -#ifdef HAVE_WIRINGPI_H - srv_send((char *)"201 Information follows"); - for (j = 0; j < 4; j++) { - sprintf(obuf, " "); - obuf[20] = '\0'; - for (i = 0; i < 20; i++) - obuf[i] = lcdbuf[lcdHandle][i][j]; - srv_send(obuf); - } - srv_send((char *)"."); -#else - srv_send((char *)"403 LCD not available"); -#endif } else if (strncmp(buf, "LIST", 4) == 0) { cmd_list(buf); } else if (strncmp(buf, "PROFILE", 7) == 0) { diff -r 6519fc50f543 -r 14700edd2a67 thermferm/thermferm.c --- a/thermferm/thermferm.c Tue Aug 12 12:49:26 2014 +0200 +++ b/thermferm/thermferm.c Tue Aug 12 13:09:50 2014 +0200 @@ -40,7 +40,6 @@ extern sys_config Config; #ifdef HAVE_WIRINGPI_H extern int lcdHandle; -extern unsigned char lcdbuf[MAX_LCDS][20][4]; int setupmenu = MENU_NONE; #endif @@ -92,7 +91,7 @@ #ifdef HAVE_WIRINGPI_H void go_menu(int menu) { - mb_lcdClear(lcdHandle); + lcdClear(lcdHandle); lcdPosition(lcdHandle, 0, 0); setupmenu = menu; @@ -100,78 +99,78 @@ case MENU_NONE: lcd_buf_show(); break; - case MENU_TOP_DEFAULT: mb_lcdPuts(lcdHandle, "Setup mode."); + case MENU_TOP_DEFAULT: lcdPuts(lcdHandle, "Setup mode."); lcdPosition(lcdHandle, 0, 1); - mb_lcdPuts(lcdHandle, "Up&Down = Escape"); + lcdPuts(lcdHandle, "Up&Down = Escape"); break; - case MENU_TOP_UNITS: mb_lcdPuts(lcdHandle, "Select units"); + case MENU_TOP_UNITS: lcdPuts(lcdHandle, "Select units"); break; - case MENU_UNITS: mb_lcdPuts(lcdHandle, "Choose unit:"); + case MENU_UNITS: lcdPuts(lcdHandle, "Choose unit:"); break; - case MENU_MODE_OFF: mb_lcdPuts(lcdHandle, "Set unit OFF"); + case MENU_MODE_OFF: lcdPuts(lcdHandle, "Set unit OFF"); break; - case MENU_MODE_NONE: mb_lcdPuts(lcdHandle, "Set unit NONE"); + case MENU_MODE_NONE: lcdPuts(lcdHandle, "Set unit NONE"); break; - case MENU_NONE_HEAT: mb_lcdPuts(lcdHandle, "Switch heater"); + case MENU_NONE_HEAT: lcdPuts(lcdHandle, "Switch heater"); break; - case MENU_NONE_COOL: mb_lcdPuts(lcdHandle, "Switch cooler"); + case MENU_NONE_COOL: lcdPuts(lcdHandle, "Switch cooler"); break; - case MENU_NONE_FAN: mb_lcdPuts(lcdHandle, "Switch Fan"); + case MENU_NONE_FAN: lcdPuts(lcdHandle, "Switch Fan"); break; - case MENU_MODE_BEER: mb_lcdPuts(lcdHandle, "Set unit BEER"); + case MENU_MODE_BEER: lcdPuts(lcdHandle, "Set unit BEER"); break; - case MENU_BEER_TEMP: mb_lcdPuts(lcdHandle, "Set beer temp"); + case MENU_BEER_TEMP: lcdPuts(lcdHandle, "Set beer temp"); break; - case MENU_MODE_FRIDGE: mb_lcdPuts(lcdHandle, "Set unit FRIDGE"); + case MENU_MODE_FRIDGE: lcdPuts(lcdHandle, "Set unit FRIDGE"); break; - case MENU_FRIDGE_TEMP: mb_lcdPuts(lcdHandle, "Set fridge temp"); + case MENU_FRIDGE_TEMP: lcdPuts(lcdHandle, "Set fridge temp"); break; - case MENU_MODE_PROFILE: mb_lcdPuts(lcdHandle, "Set unit PROFILE"); + case MENU_MODE_PROFILE: lcdPuts(lcdHandle, "Set unit PROFILE"); break; - case MENU_PROFILE_SELECT: mb_lcdPuts(lcdHandle, "Select profile"); + case MENU_PROFILE_SELECT: lcdPuts(lcdHandle, "Select profile"); break; - case MENU_PROFILE_START: mb_lcdPuts(lcdHandle, "Start profile"); + case MENU_PROFILE_START: lcdPuts(lcdHandle, "Start profile"); break; - case MENU_PROFILE_PAUSE: mb_lcdPuts(lcdHandle, "Pause profile"); + case MENU_PROFILE_PAUSE: lcdPuts(lcdHandle, "Pause profile"); break; - case MENU_PROFILE_ABORT: mb_lcdPuts(lcdHandle, "Abort profile"); + case MENU_PROFILE_ABORT: lcdPuts(lcdHandle, "Abort profile"); break; - case MENU_PROFILE_RESUME: mb_lcdPuts(lcdHandle, "Resume profile"); + case MENU_PROFILE_RESUME: lcdPuts(lcdHandle, "Resume profile"); break; - case MENU_PROFILE_GOOFF: mb_lcdPuts(lcdHandle, "Set profile OFF"); + case MENU_PROFILE_GOOFF: lcdPuts(lcdHandle, "Set profile OFF"); break; - case MENU_TOP_SYS: mb_lcdPuts(lcdHandle, "System menu"); + case MENU_TOP_SYS: lcdPuts(lcdHandle, "System menu"); break; - case MENU_SYS_HALT: mb_lcdPuts(lcdHandle, "Halt system"); + case MENU_SYS_HALT: lcdPuts(lcdHandle, "Halt system"); break; - case MENU_SYS_REBOOT: mb_lcdPuts(lcdHandle, "Reboot system"); + case MENU_SYS_REBOOT: lcdPuts(lcdHandle, "Reboot system"); break; - case MENU_SYS_MASH: mb_lcdPuts(lcdHandle, "Start Mash program"); + case MENU_SYS_MASH: lcdPuts(lcdHandle, "Start Mash program"); break; - case MENU_SYS_THERMS: mb_lcdPuts(lcdHandle, "Start Thermometers"); + case MENU_SYS_THERMS: lcdPuts(lcdHandle, "Start Thermometers"); break; } } @@ -180,7 +179,7 @@ void stopLCD(void) { - mb_lcdClear(lcdHandle); + lcdClear(lcdHandle); setBacklight(0); } #endif