|
@@ -35,7 +35,6 @@ bool coffeeDescaling = false;
|
|
|
* Prints out the current time in a centered position
|
|
|
* @param line Target line in display
|
|
|
*/
|
|
|
-
|
|
|
void displayPrintTime(int line) {
|
|
|
time_t rawtime;
|
|
|
struct tm * timeinfo;
|
|
@@ -53,18 +52,20 @@ void displayPrintTime(int line) {
|
|
|
* Prints out the current temperature in a centered position
|
|
|
* @param line Target line in display
|
|
|
*/
|
|
|
-//TODO: the temperature is wrong(old value) the first time the page is opened
|
|
|
-//after the first refresh the right temperature is displayed
|
|
|
-//no idea where this comes from, datasheet says nothing about dummy readouts.
|
|
|
-//no old values are used, conversion is started before every readout...
|
|
|
void displayPrintTemp(int line) {
|
|
|
+ //TODO: the temperature is wrong(old value) the first time the page is opened
|
|
|
+ //after the first refresh the right temperature is displayed
|
|
|
+ //no idea where this comes from, datasheet says nothing about dummy readouts.
|
|
|
+ //no old values are used, conversion is started before every readout...
|
|
|
if (line > DISPLAY_ROWS)
|
|
|
line = 0;
|
|
|
|
|
|
lcdPosition(lcd, 0, line);
|
|
|
lcdPrintf(lcd, " %d C ", DS18B20_readTemp());
|
|
|
}
|
|
|
-
|
|
|
+/**
|
|
|
+ * Prints the total epsressi brewed since reset
|
|
|
+ */
|
|
|
void displayPrintStats(int line) {
|
|
|
char buffer[17];
|
|
|
if (line > DISPLAY_ROWS)
|
|
@@ -74,7 +75,9 @@ void displayPrintStats(int line) {
|
|
|
sprintf(buffer, "%7d espressi", getBrewCounter());
|
|
|
lcdPrintf(lcd, buffer);
|
|
|
}
|
|
|
-
|
|
|
+/**
|
|
|
+ * Prints the total heating time in kWh
|
|
|
+ */
|
|
|
void displayPrintStats2(int line) {
|
|
|
char buffer[17];
|
|
|
if (line > DISPLAY_ROWS)
|
|
@@ -86,7 +89,7 @@ void displayPrintStats2(int line) {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
+ * Prints the remaining time or the remaining cups until the next descaling is necessary
|
|
|
*/
|
|
|
void displayPrintNextDesc(int line) {
|
|
|
char buffer[17];
|
|
@@ -101,7 +104,6 @@ void displayPrintNextDesc(int line) {
|
|
|
* Prints out the total volume flow
|
|
|
* @param line Target line in display
|
|
|
*/
|
|
|
-
|
|
|
void displayPrintFlow(int line) {
|
|
|
float flow = halGetFlow();
|
|
|
lcdPosition(lcd, 0, line);
|
|
@@ -142,6 +144,10 @@ void displayPrintLn(int line, const char* str, bool centered) {
|
|
|
buf[i] = ' ';
|
|
|
}
|
|
|
}
|
|
|
+ //draw the descaling star
|
|
|
+ if(coffeeDescaling && line == 0){
|
|
|
+ buf[15] = '*';
|
|
|
+ }
|
|
|
lcdPosition(lcd, 0, line);
|
|
|
buf[DISPLAY_COLS] = '\0';
|
|
|
lcdPrintf(lcd, buf);
|
|
@@ -216,6 +222,24 @@ void displayDescaling(event_t *event) {
|
|
|
coffeeDescaling = *(bool*) event->data;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * Prints the logo (CoffeePi) and also the temperature with the logo (CoffeePi@72C) if the machine is on
|
|
|
+ */
|
|
|
+void displayPrintLogo(void) {
|
|
|
+ char buffer[17];
|
|
|
+ switch (coffeeState) {
|
|
|
+ case STATE_HEATING:
|
|
|
+ case STATE_INITALHEATING:
|
|
|
+ case STATE_IDLE:
|
|
|
+ sprintf(buffer, "CoffeePi @ %dC", DS18B20_readTemp());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ sprintf(buffer, "CoffeePi");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ displayPrintLn(0, buffer, true);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Handles cleanup before program termination
|
|
|
*/
|
|
@@ -342,25 +366,24 @@ void displaySetLang(display_lang_t lang) {
|
|
|
void displayRefresh(void) {
|
|
|
if (coffeeMode == MODE_STATE) {
|
|
|
switch (coffeeState) { //coffeeGetState()
|
|
|
- //TODO show the temperature when the machine is ready to brew
|
|
|
case STATE_IDLE:
|
|
|
- displayPrintLn(0, "CoffeePi", true);
|
|
|
+ displayPrintLogo();
|
|
|
displayPrintLn(1, displayGetString(str_ready), true);
|
|
|
break;
|
|
|
|
|
|
case STATE_INITALHEATING:
|
|
|
- displayPrintLn(0, "CoffeePi", true);
|
|
|
+ displayPrintLogo();
|
|
|
displayPrintLn(1, displayGetString(str_heating), true);
|
|
|
break;
|
|
|
|
|
|
case STATE_HEATING:
|
|
|
- displayPrintLn(0, "CoffeePi", true);
|
|
|
+ displayPrintLogo();
|
|
|
displayPrintLn(1, displayGetString(str_heatingready), true);
|
|
|
break;
|
|
|
|
|
|
case STATE_BREW:
|
|
|
if (elapsedCnt <= 2 * REFRESH_RATE) {
|
|
|
- displayPrintLn(0, "CoffeePi", true);
|
|
|
+ displayPrintLogo();
|
|
|
displayPrintLn(1, displayGetString(str_brewing), true);
|
|
|
} else {
|
|
|
displayPrintLn(0, displayGetString(str_brewing), true);
|
|
@@ -374,32 +397,26 @@ void displayRefresh(void) {
|
|
|
break;
|
|
|
|
|
|
case STATE_CLEANING:
|
|
|
- displayPrintLn(0, "CoffeePi", true);
|
|
|
+ displayPrintLogo();
|
|
|
displayPrintLn(1, displayGetString(str_cleaning), true);
|
|
|
break;
|
|
|
|
|
|
case STATE_ERROR:
|
|
|
- displayPrintLn(0, "CoffeePi", true);
|
|
|
+ displayPrintLogo();
|
|
|
displayPrintLn(1, displayGetString(str_error), true);
|
|
|
break;
|
|
|
|
|
|
case STATE_WAIT_OFF:
|
|
|
- displayPrintLn(0, "CoffeePi", true);
|
|
|
+ displayPrintLogo();
|
|
|
displayPrintLn(1, displayGetString(str_waitoff), true);
|
|
|
break;
|
|
|
|
|
|
case STATE_OFF:
|
|
|
default:
|
|
|
- displayPrintLn(0, "CoffeePi", true);
|
|
|
+ displayPrintLogo();
|
|
|
displayPrintTime(1);
|
|
|
break;
|
|
|
}
|
|
|
- //draw the descaling star
|
|
|
- if(coffeeDescaling){
|
|
|
- lcdPosition(lcd, 15, 0);
|
|
|
- lcdPutchar(lcd, '*');
|
|
|
- }
|
|
|
-
|
|
|
} else if (coffeeMode == MODE_MENU) {
|
|
|
switch (coffeePage) {
|
|
|
case PAGE_SOFTOFF:
|