Skip to content

Commit

Permalink
Bugfix: wrong time changed (brewswitchdelay). Added variable brewSwit…
Browse files Browse the repository at this point in the history
…chLongPress to brewscale.ini. Rename BREWSWITCHDELAY to SHOTTIMEDISPLAY, adapt comment in ini file
  • Loading branch information
genkigenki committed Dec 15, 2023
1 parent 80db731 commit 58e699f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/brewscaleini.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ unsigned long startingTime = 0; // start time of brew
boolean brewPIDdisabled = false; // is PID disabled for delay after brew has started?
const unsigned long analogreadingtimeinterval = 10; // ms
unsigned long previousMillistempanalogreading; // ms for analogreading
const unsigned long brewSwitchLongPress = 500; // time in ms until brew trigger will be interpreted as manual brewing

// Shot timer with or without scale
#if (ONLYPIDSCALE == 1 || BREWMODE == 2)
Expand Down
2 changes: 1 addition & 1 deletion src/brewvoid.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void checkbrewswitch() {
}

// Button more than one 1sec pushed
if (brewswitchTrigger == HIGH && (brewswitchTriggermillis + 1000 <= millis())) {
if (brewswitchTrigger == HIGH && (brewswitchTriggermillis + brewSwitchLongPress <= millis())) {
debugPrintln("brewswitchTriggerCase 20: Manual Trigger - brewing");
brewswitchTriggerCase = 31;
digitalWrite(PIN_VALVE, relayON);
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ void handleMachineState() {
case kShotTimerAfterBrew:
brewDetection();

if (millis() - lastbrewTimeMillis > BREWSWITCHDELAY) {
if (millis() - lastbrewTimeMillis > SHOTTIMEDISPLAY) {
debugPrintf("Shot time: %4.1f s\n", lastbrewTime / 1000);
machineState = kBrewDetectionTrailing;
lastbrewTime = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/userConfig_sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ enum MACHINE {
#define SHOTTIMER 1 // 0 = deactivated, 1 = activated 2 = with scale
#define HEATINGLOGO 0 // 0 = deactivated, 1 = Rancilio, 2 = Gaggia
#define OFFLINEGLOGO 1 // 0 = deactivated, 1 = activated
#define BREWSWITCHDELAY 500 // time in ms that the brew switch will be delayed (shot timer will show that much longer after switching off)
#define SHOTTIMEDISPLAY 3000 // time in ms that shot timer will be shown after brew finished
#define VERBOSE 0 // 1 = Show verbose output (serial connection), 0 = show less

#define LANGUAGE 0 // LANGUAGE = 0 (DE), LANGUAGE = 1 (EN), LANGUAGE = 2 (ES)
Expand Down

0 comments on commit 58e699f

Please sign in to comment.