Преглед на файлове

Added some code to be able to brew without a flow sensor

Sebastian преди 6 години
родител
ревизия
a73cbfb1e5
променени са 3 файла, в които са добавени 6 реда и са изтрити 5 реда
  1. 1 1
      CoffeeCode/buildno
  2. 4 4
      CoffeeCode/coffee.cpp
  3. 1 0
      CoffeeCode/coffee.h

+ 1 - 1
CoffeeCode/buildno

@@ -1 +1 @@
-260
+261

+ 4 - 4
CoffeeCode/coffee.cpp

@@ -789,8 +789,8 @@ void coffeeBrew(void) {
 	halRelaisOn(RELAIS_PUMP);
 	brewTime = 0;
 	brewTimer.start();
-	while (halGetFlow() < AMOUNT_PREINFUSION) {
-		coffeeNap(0,50000000);
+	while (halGetFlow() < AMOUNT_PREINFUSION && brewTime < TIME_PREINFUSION) {
+		coffeeNap(0, 50000000);
 		if (getSigValue(MODE_STATE) == SigInt0Psh){
 			stopBrewing();
 			return;
@@ -803,7 +803,7 @@ void coffeeBrew(void) {
 	 */
 	brewTimer.start();
 	while (brewTime < TIME_SOAK) {
-		coffeeNap(1,100000000);
+		coffeeNap(1, 100000000);
 		if (getSigValue(MODE_STATE) == SigInt0Psh) {
 			stopBrewing();
 			return;
@@ -818,7 +818,7 @@ void coffeeBrew(void) {
 	halRelaisOn(RELAIS_PUMP);
 	brewTimer.start();
 	while (brewTime < TIME_INFUSION && halGetFlow() < AMOUNT_DBLESPRESSO) {
-		coffeeNap(1,100000000);
+		coffeeNap(1, 100000000);
 		if (getSigValue(MODE_STATE) == SigInt0Psh){
 			stopBrewing();
 			break;

+ 1 - 0
CoffeeCode/coffee.h

@@ -48,6 +48,7 @@ extern const char* PageName[];
 #define AMOUNT_PREINFUSION	24 		//Preinfusion amount in ml
 #define TIME_SOAK			5000 	//Time between preinfusion and infusion in ms
 #define TIME_INFUSION 		25000	//Infusion time in ms
+#define TIME_PREINFUSION	2500
 #define AMOUNT_DBLESPRESSO	59.0	//Size of a double espresso in ml
 #define DIRTY_ESPRESSO		35		//Number of espressi until the next cleaning
 #define DIRTY_TIME			90		//Number of days until the next cleaning