Browse Source

removed todo to detect the manual brewing process, SigBrewOn is now only send once, this should fix the wrong display while brewing manually and the false incrase fo the brewcounter, changed the constant when a manual brewing signal will be send

Sebastian Vendt 5 năm trước cách đây
mục cha
commit
171b0caf02
4 tập tin đã thay đổi với 8 bổ sung12 xóa
  1. 1 1
      CoffeeCode/buildno
  2. 2 2
      CoffeeCode/coffee.cpp
  3. 4 8
      CoffeeCode/hal.cpp
  4. 1 1
      CoffeeCode/hal.h

+ 1 - 1
CoffeeCode/buildno

@@ -1 +1 @@
-339
+343

+ 2 - 2
CoffeeCode/coffee.cpp

@@ -476,6 +476,7 @@ void *coffeeThread(void *threadid) {
 
 			case SigBrewOn:
 				//someone brews manually
+				coffeeManualBrewStart();
 				changeState(STATE_BREWMANUAL);
 				break;
 
@@ -522,6 +523,7 @@ void *coffeeThread(void *threadid) {
 
 			case SigBrewOn:
 				//someone brews manually
+				coffeeManualBrewStart();
 				changeState(STATE_BREWMANUAL);
 				break;
 
@@ -566,7 +568,6 @@ void *coffeeThread(void *threadid) {
 			 *
 			 */
 		case STATE_BREWMANUAL:
-			coffeeManualBrewStart();
 			if (SigValueEmpty() && mode == MODE_STATE)
 				pause();
 			switch (getSigValue(MODE_STATE)) {
@@ -585,7 +586,6 @@ void *coffeeThread(void *threadid) {
 			 *
 			 */
 		case STATE_CLEANING: //this can only be executed once the machine is hot!
-			//TODO Show the progress of the cleaning process
 			if (!halProxSensorCovered()) {
 				//execute the cleaning procedure
 				coffeeClean();

+ 4 - 8
CoffeeCode/hal.cpp

@@ -19,7 +19,9 @@
 #include "timer.h"
 #include "database.h"
 
-const char* SigName[] = {"SigInt0Psh",
+const char* SigName[] = {
+		"NULL",
+		"SigInt0Psh",
 		"SigInt0Rls",
 		"SigInt0RlsLong",
 		"SigInt1Psh",
@@ -377,17 +379,11 @@ void halIntFlow(void) {
 	logger(V_HAL, "IntFlow triggered #%d total: %.2fml\n", flowcnt, halGetFlow());
 	flowcnt++;
 
-	if(flowcnt >= BREW_MANUAL_TRIGGER) {
+	if(flowcnt >= BREW_MANUAL_TRIGGER && !brewmanual) { //send signal once
 		halSendSignal(SigBrewOn);
 		brewmanual = true;
 	}
 
-	//detect a manual brewing process
-	//TODO to be able to detect a manual brewing process we need to have the following
-	//autoclear the flowcnt after certain idle time
-	//detect when the the flow is triggered but the pump is not started from software
-	//here we need to suppress the false alarms when the pump is turned off and slowly running out
-
 
 	//subroutine to log the flow to the database
 	/*timespec deltaT;

+ 1 - 1
CoffeeCode/hal.h

@@ -31,7 +31,7 @@
 
 
 #define TIME_BUTTONLONGPRESS	3	//Time in s until a Signal for a long pressed button is sent
-#define BREW_MANUAL_TRIGGER		15	//specifes the flow ticks after which a brew_manual signal is triggered (14 eq. approx. 7ml)
+#define BREW_MANUAL_TRIGGER		25	//specifies the flow ticks after which a brew_manual signal is triggered (25 eq. approx. 11ml)
 /*
  * Explanation for the signal levels
  * SigInt_Psh 			Button is pushed