Skip to content

Commit

Permalink
Merge pull request #410 from LoQue90/fix-display-and-cleanup
Browse files Browse the repository at this point in the history
fix display template and clean up
  • Loading branch information
LoQue90 authored Dec 9, 2023
2 parents 9f6d20a + 1dd256e commit ac1d642
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
31 changes: 19 additions & 12 deletions src/Displayrotateupright.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,27 @@ void displayLogo(String displaymessagetext, String displaymessagetext2) {
u8g2.drawStr(0, 55, displaymessagetext2.c_str());

// Rancilio startup logo
switch (machineLogo) {
case 1:
u8g2.drawXBMP(9, 2, startLogoRancilio_width, startLogoRancilio_height, startLogoRancilio_bits);
switch (machine) {
case RancilioSilvia: // Rancilio
u8g2.drawXBMP(41, 2, startLogoRancilio_width, startLogoRancilio_height,
startLogoRancilio_bits);
break;

case 2:
u8g2.drawXBMP(0, 2, startLogoGaggia_width, startLogoGaggia_height, startLogoGaggia_bits);
case RancilioSilviaE: // Rancilio
u8g2.drawXBMP(41, 2, startLogoRancilio_width, startLogoRancilio_height,
startLogoRancilio_bits);
break;

case 3:
u8g2.drawXBMP(22, 0, startLogoQuickMill_width, startLogoQuickMill_height, startLogoQuickMill_bits);
case Gaggia: // Gaggia
u8g2.drawXBMP(0, 2, startLogoGaggia_width, startLogoGaggia_height,
startLogoGaggia_bits);
break;
}

case QuickMill: // Quickmill
u8g2.drawXBMP(22, 0, startLogoQuickMill_width, startLogoQuickMill_height,
startLogoQuickMill_bits);
break;
}
u8g2.sendBuffer();
}

Expand Down Expand Up @@ -118,15 +125,15 @@ void displayShottimer(void) {
u8g2.sendBuffer();

}
if (SHOTTIMER == 1 && millis() >= brewTime_last_Millis && // directly after creating brewTime_last_mills (happens when turning off the brew switch, case 43 in the code) should be started
brewTime_last_Millis+brewswitchDelay >= millis() && // should run until millis() has caught up with brewswitchDelay, this can be used to control the display duration
brewTime_last_Millis < totalBrewTime) // if the totalBrewTime is reached automatically, nothing should be done, otherwise wrong time will be displayed because switch is pressed later than totalBrewTime
if (SHOTTIMER == 1 && millis() >= lastbrewTimeMillis && // directly after creating lastbrewTimeMillis (happens when turning off the brew switch, case 43 in the code) should be started
lastbrewTimeMillis + BREWSWITCHDELAY >= millis() && // should run until millis() has caught up with BREWSWITCHDELAY, this can be used to control the display duration
lastbrewTimeMillis < totalBrewTime) // if the totalBrewTime is reached automatically, nothing should be done, otherwise wrong time will be displayed because switch is pressed later than totalBrewTime
{
u8g2.clearBuffer();
u8g2.drawXBMP(0, 0, brewlogo_width, brewlogo_height, brewlogo_bits_u8g2);
u8g2.setFont(u8g2_font_profont22_tf);
u8g2.setCursor(5, 70);
u8g2.print((brewTime_last_Millis - startingTime) / 1000, 1);
u8g2.print((lastbrewTimeMillis - startingTime) / 1000, 1);
u8g2.setFont(u8g2_font_profont11_tf);
u8g2.sendBuffer();
}
Expand Down
4 changes: 2 additions & 2 deletions src/userConfig_sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ enum MACHINE {
#define WIFICONNECTIONDELAY 10000 // delay between reconnects in ms

// PID & Hardware
#define ONLYPID 1 // 1 = Only PID, 0 = PID and preinfusion
#define ONLYPID 1 // 0 = PID and preinfusion, 1 = Only PID
#define ONLYPIDSCALE 0 // 0 = off , 1 = OnlyPID with Scale
#define BREWMODE 1 // 1 = Brew by time (with preinfusion); 2 = Brew by weight (from scale)
#define BREWDETECTION 0 // 0 = off, 1 = Software (Onlypid 1), 2 = Hardware (Onlypid 0), 3 = Sensor/Hardware for Only PID
#define BREWSWITCHTYPE 0 // 0 = no switch connected, 1 = normal switch, 2 = trigger switch
#define POWERSWITCHTYPE 0 // 0 = no switch connected, 1 = normal switch, 2 = trigger switch
#define STEAMSWITCHTYPE 0 // 0 = no switch connected, 1 = normal switch, 2 = trigger switch
#define TRIGGERTYPE HIGH // LOW = low trigger, HIGH = high trigger relay for pump & valve
#define VOLTAGESENSORTYPE HIGH // BREWDETECTION 3 configuration
#define VOLTAGESENSORTYPE HIGH // BREWDETECTION 3 configuration (HIGH or LOW trigger optocoupler)
#define PINMODEVOLTAGESENSOR INPUT // Mode INPUT_PULLUP, INPUT or INPUT_PULLDOWN_16 (Only Pin 16)
#define PRESSURESENSOR 0 // 0 = no pressure sensor connected, 1 = pressure sensor connected
#define TEMP_LED 1 // Blink status LED when temp is in range
Expand Down

0 comments on commit ac1d642

Please sign in to comment.