--- a/brewco/brewco.c Sat Nov 28 21:00:29 2015 +0100 +++ b/brewco/brewco.c Wed Dec 02 17:16:41 2015 +0100 @@ -48,6 +48,19 @@ #endif +/* + * CGRAM characters + */ +unsigned char degC[8] = { 0b01000, 0b10100, 0b01000, 0b00111, 0b01000, 0b01000, 0b01000, 0b00111 }; +unsigned char degF[8] = { 0b01000, 0b10100, 0b01000, 0b00111, 0b00100, 0b00110, 0b00100, 0b00100 }; +unsigned char SP_Symbol[8] = { 0b11100, 0b10000, 0b11100, 0b00111, 0b11101, 0b00111, 0b00100, 0b00100 }; +unsigned char PumpONOFF[8] = { 0b00000, 0b01110, 0b01010, 0b01110, 0b01000, 0b01000, 0b01000, 0b00000 }; +unsigned char RevPumpONOFF[8] = { 0b11111, 0b10001, 0b10101, 0b10001, 0b10111, 0b10111, 0b10111, 0b11111 }; +unsigned char HeatONOFF[8] = { 0b00000, 0b01010, 0b01010, 0b01110, 0b01110, 0b01010, 0b01010, 0b00000 }; +unsigned char RevHeatONOFF[8] = { 0b11111, 0b10101, 0b10101, 0b10001, 0b10001, 0b10101, 0b10101, 0b11111 }; +unsigned char Language[8] = { 0b11111, 0b00010, 0b01000, 0b11111, 0b00000, 0b10001, 0b10101, 0b11111 }; + + void help(void); void die(int); @@ -94,6 +107,22 @@ long t = 0; #endif + prompt(101, NULL); + + /* + * Define special characters in the display CGRAM + */ + if (Config.tempFormat == 'C') + slcdCharDef(slcdHandle, 1, degC); + else + slcdCharDef(slcdHandle, 1, degF); + slcdCharDef(slcdHandle, 2, SP_Symbol); + slcdCharDef(slcdHandle, 3, PumpONOFF); + slcdCharDef(slcdHandle, 4, RevPumpONOFF); + slcdCharDef(slcdHandle, 5, HeatONOFF); + slcdCharDef(slcdHandle, 6, RevHeatONOFF); + slcdCharDef(slcdHandle, 7, Language); + // if (lockprog((char *)"brewco")) { // syslog(LOG_NOTICE, "Can't lock"); // return 1; @@ -170,13 +199,12 @@ } } - prompt(101); if (! Config.units) { /* * No brewsystems defined, add the first */ - prompt(218); /* Add Brewsystem? */ - prompt(407); /* --- --- Ok --- */ + prompt(218, NULL); /* Add Brewsystem? */ + prompt(407, NULL); /* --- --- Ok --- */ do { key = keywait(); @@ -217,9 +245,10 @@ /* * Not running. */ - prompt(0); - prompt(101); - prompt(401); + prompt(0, NULL); + prompt(101, NULL); + prompt(300, (char *)"---\001-\002-\003-\004-\005-\006-\007----"); + prompt(401, NULL); key = keywait(); if (key == KEY_ENTER) setup(); @@ -233,9 +262,9 @@ if (debug) fprintf(stdout, (char *)"Out of loop\n"); - prompt(0); - prompt(101); - prompt(302); + prompt(0, NULL); + prompt(101, NULL); + prompt(302, NULL); /* * Stop units processing in a neat way @@ -249,7 +278,7 @@ */ usleep(1500000); - prompt(0); + prompt(0, NULL); // stopLCD(); if (sock != -1) { if (shutdown(sock, SHUT_RDWR)) {