Browse Source

Some brewing optimizations and fixes

Philipp Hinz 7 years ago
parent
commit
34f243e896
4 changed files with 6 additions and 5 deletions
  1. 1 1
      CoffeeCode/buildno
  2. 1 1
      CoffeeCode/coffee.cpp
  3. 2 2
      CoffeeCode/coffee.h
  4. 2 1
      CoffeeCode/main.cpp

+ 1 - 1
CoffeeCode/buildno

@@ -1 +1 @@
-97
+105

+ 1 - 1
CoffeeCode/coffee.cpp

@@ -295,7 +295,7 @@ void coffeeBrew(void) {
 	brewTime = 0;
 	brewTimer.start();
 	while (halGetFlow() < AMOUNT_PREINFUSION) {
-		usleep(100000);
+		usleep(50000);
 		if (getSigValue() == SigInt1Psh)
 			return;
 	}

+ 2 - 2
CoffeeCode/coffee.h

@@ -21,10 +21,10 @@ typedef enum {
 	STATE_ERROR
 } coffee_status_t;
 
-#define AMOUNT_PREINFUSION	28 //Preinfusion amount in ml
+#define AMOUNT_PREINFUSION	25 //Preinfusion amount in ml
 #define TIME_SOAK			5000 //Time between preinfusion and infusion in ms
 #define TIME_INFUSION 		25000	//Infusion time in ms
-#define AMOUNT_DBLESPRESSO	49.0	//Size of a double espresso in ml
+#define AMOUNT_DBLESPRESSO	59.0	//Size of a double espresso in ml
 void *coffeeThread(void *threadid);
 
 void coffeeHandler(int signum, siginfo_t *siginfo, void *context);

+ 2 - 1
CoffeeCode/main.cpp

@@ -52,7 +52,7 @@ int main(int argc, char *argv[]) {
 			"Build number %d\n", buildno);
 
 	// Argument handling
-	while (prev_ind = optind, (opt = getopt(argc, argv, "vVdp")) != -1) {
+	while (prev_ind = optind, (opt = getopt(argc, argv, "?hvVdp")) != -1) {
 		if (argc > 3)
 			if (optind == prev_ind + 2 && *optarg == '-') {
 				opt = '?';
@@ -79,6 +79,7 @@ int main(int argc, char *argv[]) {
 			printf("\t-h\t\tPrints this help\n");
 			printf("\t-v\t\tSets verbose output, can be used multiple times\n");
 			printf("\t-V\t\tPrints only the version and exits\n");
+			printf("\t-d\t\tPrints a timestamp before every line\n");
 			printf("\t-p\t\tPowers the machine on program start\n");
 
 			printf("Listening to the following signals:\n");