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 years ago
parent
commit
171b0caf02
4 changed files with 8 additions and 12 deletions
  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:
 			case SigBrewOn:
 				//someone brews manually
 				//someone brews manually
+				coffeeManualBrewStart();
 				changeState(STATE_BREWMANUAL);
 				changeState(STATE_BREWMANUAL);
 				break;
 				break;
 
 
@@ -522,6 +523,7 @@ void *coffeeThread(void *threadid) {
 
 
 			case SigBrewOn:
 			case SigBrewOn:
 				//someone brews manually
 				//someone brews manually
+				coffeeManualBrewStart();
 				changeState(STATE_BREWMANUAL);
 				changeState(STATE_BREWMANUAL);
 				break;
 				break;
 
 
@@ -566,7 +568,6 @@ void *coffeeThread(void *threadid) {
 			 *
 			 *
 			 */
 			 */
 		case STATE_BREWMANUAL:
 		case STATE_BREWMANUAL:
-			coffeeManualBrewStart();
 			if (SigValueEmpty() && mode == MODE_STATE)
 			if (SigValueEmpty() && mode == MODE_STATE)
 				pause();
 				pause();
 			switch (getSigValue(MODE_STATE)) {
 			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!
 		case STATE_CLEANING: //this can only be executed once the machine is hot!
-			//TODO Show the progress of the cleaning process
 			if (!halProxSensorCovered()) {
 			if (!halProxSensorCovered()) {
 				//execute the cleaning procedure
 				//execute the cleaning procedure
 				coffeeClean();
 				coffeeClean();

+ 4 - 8
CoffeeCode/hal.cpp

@@ -19,7 +19,9 @@
 #include "timer.h"
 #include "timer.h"
 #include "database.h"
 #include "database.h"
 
 
-const char* SigName[] = {"SigInt0Psh",
+const char* SigName[] = {
+		"NULL",
+		"SigInt0Psh",
 		"SigInt0Rls",
 		"SigInt0Rls",
 		"SigInt0RlsLong",
 		"SigInt0RlsLong",
 		"SigInt1Psh",
 		"SigInt1Psh",
@@ -377,17 +379,11 @@ void halIntFlow(void) {
 	logger(V_HAL, "IntFlow triggered #%d total: %.2fml\n", flowcnt, halGetFlow());
 	logger(V_HAL, "IntFlow triggered #%d total: %.2fml\n", flowcnt, halGetFlow());
 	flowcnt++;
 	flowcnt++;
 
 
-	if(flowcnt >= BREW_MANUAL_TRIGGER) {
+	if(flowcnt >= BREW_MANUAL_TRIGGER && !brewmanual) { //send signal once
 		halSendSignal(SigBrewOn);
 		halSendSignal(SigBrewOn);
 		brewmanual = true;
 		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
 	//subroutine to log the flow to the database
 	/*timespec deltaT;
 	/*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 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
  * Explanation for the signal levels
  * SigInt_Psh 			Button is pushed
  * SigInt_Psh 			Button is pushed