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

adapted new flow sensor diameter, bugfixes

Philipp Hinz преди 6 години
родител
ревизия
8eab6946b2
променени са 4 файла, в които са добавени 6 реда и са изтрити 7 реда
  1. 1 1
      CoffeeCode/buildno
  2. 4 2
      CoffeeCode/display.cpp
  3. 0 3
      CoffeeCode/hal.cpp
  4. 1 1
      CoffeeCode/hal.h

+ 1 - 1
CoffeeCode/buildno

@@ -1 +1 @@
-260
+263

+ 4 - 2
CoffeeCode/display.cpp

@@ -167,7 +167,8 @@ void displayStateUpdated(event_t *event) {
 	coffee_status_t state = *(coffee_status_t*) event->data;
 	if (state != coffeeState) {
 		coffeeState = state;
-		timerScaler = REFRESH_RATE;
+		if (timerScaler)
+			timerScaler--;
 		elapsedCnt = 0;
 		displayTimer.call();
 	}
@@ -186,7 +187,8 @@ void displayModeUpdated(event_t *event) {
 	coffee_mode_t mode = *(coffee_mode_t*) event->data;
 	if (mode != coffeeMode) {
 		coffeeMode = mode;
-		timerScaler = REFRESH_RATE;
+		if (timerScaler)
+			timerScaler--;
 		elapsedCnt = 0;
 		displayTimer.call();
 	}

+ 0 - 3
CoffeeCode/hal.cpp

@@ -259,9 +259,6 @@ void halInt1TimerHandler(void) {
 void halIntFlow(void) {
 	//halRelaisOff(RELAIS_POWER);
 	logger(V_HAL, "IntFlow triggered #%d total: %.2fml\n", flowcnt, halGetFlow());
-	if (flowcnt == 99) {
-		halRelaisOff(RELAIS_PUMP);
-	}
 	flowcnt++;
 }
 

+ 1 - 1
CoffeeCode/hal.h

@@ -17,7 +17,7 @@
 #define PIN_INT1		0 // Bottom button
 #define PIN_FLOW		3 // Flow sensor
 #define PIN_DISP		4
-#define FLOW_ML_PULSE	(1000.0/990) // Flow sensor: volume (ml) per pulse
+#define FLOW_ML_PULSE	(1000.0/2219) // Flow sensor: volume (ml) per pulse
 
 #define TIME_BUTTONLONGPRESS	3	//Time in s until a Signal for a long pressed button is sent
 /*