main/automation.c

changeset 54
7b134c27fadb
parent 43
2079940c3989
child 56
756d1a63d129
equal deleted inserted replaced
53:cf91a3a20d0d 54:7b134c27fadb
84 } 84 }
85 ESP_LOGI(TAG, "Last mash step %d", LastMashStep); 85 ESP_LOGI(TAG, "Last mash step %d", LastMashStep);
86 86
87 // Check for a crashed session. 87 // Check for a crashed session.
88 if (runtime.AutoModeStarted) { 88 if (runtime.AutoModeStarted) {
89 TopMessage("Brouwen hervatten?"); 89 TopMessage((char *)"Brouwen hervatten?");
90 Buttons_Add( 40, 100, 80, 40, "Ja", 0); 90 Buttons_Add( 40, 100, 80, 40, (char *)"Ja", 0);
91 Buttons_Add(200, 100, 80, 40, "Nee", 1); 91 Buttons_Add(200, 100, 80, 40, (char *)"Nee", 1);
92 Buttons_Show(); 92 Buttons_Show();
93 SoundPlay(SOUND_Prompt); 93 SoundPlay(SOUND_Prompt);
94 loop = true; 94 loop = true;
95 while (loop) { 95 while (loop) {
96 switch (Buttons_Scan()) { 96 switch (Buttons_Scan()) {
112 xSemaphoreGive(xSemaphoreDriver); 112 xSemaphoreGive(xSemaphoreDriver);
113 } 113 }
114 ESP_LOGI(TAG, "Resume brew screen %d, time left %d", Main_Screen, TimeLeft); 114 ESP_LOGI(TAG, "Resume brew screen %d, time left %d", Main_Screen, TimeLeft);
115 log_begin((time_t)0); 115 log_begin((time_t)0);
116 update_json(); 116 update_json();
117 log_annotation(ANNOTATION_SYSTEM, "Resume"); 117 log_annotation(ANNOTATION_SYSTEM, (char *)"Resume");
118 return true; 118 return true;
119 break; 119 break;
120 120
121 case 1: loop = false; 121 case 1: loop = false;
122 Resume = false; 122 Resume = false;
158 if (runtime.UseHLT) { 158 if (runtime.UseHLT) {
159 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { 159 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) {
160 driver_state->hlt_mode = HLT_MODE_BANG; 160 driver_state->hlt_mode = HLT_MODE_BANG;
161 xSemaphoreGive(xSemaphoreDriver); 161 xSemaphoreGive(xSemaphoreDriver);
162 } 162 }
163 TopMessage("Spoelwater opwarmen"); 163 TopMessage((char *)"Spoelwater opwarmen");
164 MLT_info(71, 26, false); 164 MLT_info(71, 26, false);
165 HLT_info(71,150, false, false); 165 HLT_info(71,150, false, false);
166 } 166 }
167 break; 167 break;
168 168
200 MaxMash = 75.0; 200 MaxMash = 75.0;
201 } 201 }
202 } 202 }
203 MashState = Sub_Screen = MASH_NONE; 203 MashState = Sub_Screen = MASH_NONE;
204 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); 204 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen);
205 ws_server_send_text_clients("/ws", msg, strlen(msg)); 205 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg));
206 pumpTime = 0; 206 pumpTime = 0;
207 pumpRest = false; 207 pumpRest = false;
208 runtime.StageResume = Main_Screen; 208 runtime.StageResume = Main_Screen;
209 updateRuntime = true; 209 updateRuntime = true;
210 TopMessage("Maischen"); 210 TopMessage((char *)"Maischen");
211 MLT_info(71, 26, false); 211 MLT_info(71, 26, false);
212 if (_UseHLT) { 212 if (_UseHLT) {
213 HLT_info(71,170, false, true); 213 HLT_info(71,170, false, true);
214 } 214 }
215 break; 215 break;
225 225
226 runtime.StageResume = Main_Screen; 226 runtime.StageResume = Main_Screen;
227 updateRuntime = true; 227 updateRuntime = true;
228 TempReached = false; 228 TempReached = false;
229 229
230 TopMessage("Naar koken"); 230 TopMessage((char *)"Naar koken");
231 MLT_info(71, 26, false); 231 MLT_info(71, 26, false);
232 Buttons_Add( 5, 30, 60, 40, "+sp", 0); 232 Buttons_Add( 5, 30, 60, 40, (char *)"+sp", 0);
233 Buttons_Add(255, 30, 60, 40, "-sp", 1); 233 Buttons_Add(255, 30, 60, 40, (char *)"-sp", 1);
234 Buttons_Show(); 234 Buttons_Show();
235 ESP_LOGI(TAG, "Mash done, going to boil."); 235 ESP_LOGI(TAG, "Mash done, going to boil.");
236 Sub_Screen = 0; 236 Sub_Screen = 0;
237 break; 237 break;
238 238
253 xSemaphoreGive(xSemaphoreDriver); 253 xSemaphoreGive(xSemaphoreDriver);
254 } 254 }
255 SoundPlay(SOUND_TempReached); 255 SoundPlay(SOUND_TempReached);
256 BoilPower = equipment.BoilPower; 256 BoilPower = equipment.BoilPower;
257 updateRuntime = true; 257 updateRuntime = true;
258 TopMessage("Koken"); 258 TopMessage((char *)"Koken");
259 MLT_info(71, 26, false); 259 MLT_info(71, 26, false);
260 Buttons_Add( 3, 30, 60, 40, "+sp", 0); 260 Buttons_Add( 3, 30, 60, 40, (char *)"+sp", 0);
261 Buttons_Add(257, 30, 60, 40, "-sp", 1); 261 Buttons_Add(257, 30, 60, 40, (char *)"-sp", 1);
262 Buttons_Add( 3, 190, 60, 40, "+1m", 2); 262 Buttons_Add( 3, 190, 60, 40, (char *)"+1m", 2);
263 Buttons_Add(257, 190, 60, 40, "-1m", 3); 263 Buttons_Add(257, 190, 60, 40, (char *)"-1m", 3);
264 Buttons_Show(); 264 Buttons_Show();
265 ESP_LOGI(TAG, "Boil temperature reached, boil %d minutes", (TimeLeft / 60) -1); 265 ESP_LOGI(TAG, "Boil temperature reached, boil %d minutes", (TimeLeft / 60) -1);
266 log_annotation(ANNOTATION_STAGE, "Koken"); 266 log_annotation(ANNOTATION_STAGE, (char *)"Koken");
267 Sub_Screen = 0; 267 Sub_Screen = 0;
268 break; 268 break;
269 269
270 case MAIN_AUTO_COOLING_H: 270 case MAIN_AUTO_COOLING_H:
271 case MAIN_AUTO_COOLING_M: 271 case MAIN_AUTO_COOLING_M:
282 if ((Main_Screen == MAIN_AUTO_COOLING_M) && (! recipe.Whirlpool6)) { 282 if ((Main_Screen == MAIN_AUTO_COOLING_M) && (! recipe.Whirlpool6)) {
283 // Skip cooling before whirlpool 63 degrees. 283 // Skip cooling before whirlpool 63 degrees.
284 Main_Screen = MAIN_AUTO_COOLING_C; 284 Main_Screen = MAIN_AUTO_COOLING_C;
285 return true; //goto startover; 285 return true; //goto startover;
286 } 286 }
287 TopMessage("Start koelen?"); 287 TopMessage((char *)"Start koelen?");
288 Buttons_Add( 40, 100, 80, 40, "Start", 0); 288 Buttons_Add( 40, 100, 80, 40, (char *)"Start", 0);
289 Buttons_Add(200, 100, 80, 40, "Stop", 1); 289 Buttons_Add(200, 100, 80, 40, (char *)"Stop", 1);
290 Buttons[1].dark = true; 290 Buttons[1].dark = true;
291 Buttons_Show(); 291 Buttons_Show();
292 SoundPlay(SOUND_Prompt); 292 SoundPlay(SOUND_Prompt);
293 _Prompt = true; 293 _Prompt = true;
294 break; 294 break;
319 // Skip final whirlpool. 319 // Skip final whirlpool.
320 Main_Screen = MAIN_AUTO_DONE; 320 Main_Screen = MAIN_AUTO_DONE;
321 return true; //goto startover; 321 return true; //goto startover;
322 } 322 }
323 323
324 TopMessage("Start Whirlpool?"); 324 TopMessage((char *)"Start Whirlpool?");
325 Buttons_Add( 40, 100, 80, 40, "Start", 0); 325 Buttons_Add( 40, 100, 80, 40, (char *)"Start", 0);
326 Buttons_Add(200, 100, 80, 40, "Stop", 1); 326 Buttons_Add(200, 100, 80, 40, (char *)"Stop", 1);
327 Buttons[1].dark = true; 327 Buttons[1].dark = true;
328 Buttons_Show(); 328 Buttons_Show();
329 SoundPlay(SOUND_Prompt); 329 SoundPlay(SOUND_Prompt);
330 _Prompt = true; 330 _Prompt = true;
331 break; 331 break;
342 xSemaphoreGive(xSemaphoreDriver); 342 xSemaphoreGive(xSemaphoreDriver);
343 } 343 }
344 _fg = TFT_YELLOW; 344 _fg = TFT_YELLOW;
345 TFT_setFont(DEJAVU24_FONT, NULL); 345 TFT_setFont(DEJAVU24_FONT, NULL);
346 if (Main_Screen == MAIN_AUTO_DONE) { 346 if (Main_Screen == MAIN_AUTO_DONE) {
347 TFT_print("Brouwen is gereed.", CENTER, CENTER); 347 TFT_print((char *)"Brouwen is gereed.", CENTER, CENTER);
348 ESP_LOGI(TAG, "Brew is done"); 348 ESP_LOGI(TAG, "Brew is done");
349 SoundPlay(SOUND_End); 349 SoundPlay(SOUND_End);
350 } else { 350 } else {
351 TFT_print("Brouwen is afgebroken.", CENTER, CENTER); 351 TFT_print((char *)"Brouwen is afgebroken.", CENTER, CENTER);
352 ESP_LOGI(TAG, "Brew is aborted"); 352 ESP_LOGI(TAG, "Brew is aborted");
353 SoundPlay(SOUND_Warn); 353 SoundPlay(SOUND_Warn);
354 } 354 }
355 log_close(); 355 log_close();
356 runtime.Logfile[0] = '\0'; 356 runtime.Logfile[0] = '\0';
360 runtime.PumpCooling = false; 360 runtime.PumpCooling = false;
361 runtime.HopAddition = 0; 361 runtime.HopAddition = 0;
362 runtime.TimeBrewing = 0; 362 runtime.TimeBrewing = 0;
363 runtime.StageTimeLeft = 0; 363 runtime.StageTimeLeft = 0;
364 updateRuntime = true; 364 updateRuntime = true;
365 Buttons_Add(130, 200, 60, 40, "Ok", 0); 365 Buttons_Add(130, 200, 60, 40, (char *)"Ok", 0);
366 Buttons[0].dark = true; 366 Buttons[0].dark = true;
367 Buttons_Show(); 367 Buttons_Show();
368 break; 368 break;
369 369
370 default: 370 default:
393 */ 393 */
394 Sub_Screen = 1; 394 Sub_Screen = 1;
395 read_recipe(config.RecipeRec); 395 read_recipe(config.RecipeRec);
396 snprintf(msg, 255, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\",\"brew1\":\"%s\",\"brew2\":\"%s\"}", 396 snprintf(msg, 255, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\",\"brew1\":\"%s\",\"brew2\":\"%s\"}",
397 Main_Screen, Sub_Screen, equipment.Name, recipe.Name); 397 Main_Screen, Sub_Screen, equipment.Name, recipe.Name);
398 ws_server_send_text_clients("/ws", msg, strlen(msg)); 398 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg));
399 y = 28; 399 y = 28;
400 TopMessage("Automaat"); 400 TopMessage((char *)"Automaat");
401 TFT_setFont(DEFAULT_FONT, NULL); 401 TFT_setFont(DEFAULT_FONT, NULL);
402 ShowText(2,y,"Installatie", equipment.Name); 402 ShowText(2,y,(char *)"Installatie", equipment.Name);
403 y += 16; 403 y += 16;
404 ShowText(2,y,"Recept", recipe.Name); 404 ShowText(2,y,(char *)"Recept", recipe.Name);
405 y += 16; 405 y += 16;
406 ShowFloat(2, y, "Maisch in", " C", recipe.MashStep[0].Temperature, 2); 406 ShowFloat(2, y, (char *)"Maisch in", (char *)" C", recipe.MashStep[0].Temperature, 2);
407 ShowFloat(162, y, "Spoelwater", " C", recipe.SpargeTemp, 2); 407 ShowFloat(162, y, (char *)"Spoelwater", (char *)" C", recipe.SpargeTemp, 2);
408 y += 16; 408 y += 16;
409 _fg = TFT_WHITE; 409 _fg = TFT_WHITE;
410 TFT_print("Maisch stap", 2, y); 410 TFT_print((char *)"Maisch stap", 2, y);
411 TFT_print("T", 200, y); 411 TFT_print((char *)"T", 200, y);
412 TFT_print("Temp.", 220, y); 412 TFT_print((char *)"Temp.", 220, y);
413 TFT_print("Rust", 280, y); 413 TFT_print((char *)"Rust", 280, y);
414 _fg = TFT_YELLOW; 414 _fg = TFT_YELLOW;
415 y += 16; 415 y += 16;
416 for (int i = 1; i < 8; i++) { 416 for (int i = 1; i < 8; i++) {
417 if (recipe.MashStep[i].Resttime) { 417 if (recipe.MashStep[i].Resttime) {
418 TFT_print(recipe.MashStep[i].Name, 2, y); 418 TFT_print(recipe.MashStep[i].Name, 2, y);
424 sprintf(tmp, "%2d m", recipe.MashStep[i].Resttime); 424 sprintf(tmp, "%2d m", recipe.MashStep[i].Resttime);
425 TFT_print(tmp, 280, y); 425 TFT_print(tmp, 280, y);
426 y += 16; 426 y += 16;
427 } 427 }
428 } 428 }
429 ShowInteger(2, y, "Kooktijd", " min", recipe.BoilTime); 429 ShowInteger(2, y, (char *)"Kooktijd", (char *)" min", recipe.BoilTime);
430 ShowFloat(162, y, "Koel tot", " C", recipe.CoolTemp, 2); 430 ShowFloat(162, y, (char *)"Koel tot", (char *)" C", recipe.CoolTemp, 2);
431 y += 16; 431 y += 16;
432 if (recipe.Additions) { 432 if (recipe.Additions) {
433 _fg = TFT_YELLOW; 433 _fg = TFT_YELLOW;
434 sprintf(tmp, "%d ", recipe.Additions); 434 sprintf(tmp, "%d ", recipe.Additions);
435 TFT_print(tmp, 2, y); 435 TFT_print(tmp, 2, y);
436 _fg = TFT_WHITE; 436 _fg = TFT_WHITE;
437 TFT_print("toevoegingen om", LASTX, y); 437 TFT_print((char *)"toevoegingen om", LASTX, y);
438 _fg = TFT_YELLOW; 438 _fg = TFT_YELLOW;
439 for (int i = 1; i <= recipe.Additions; i++) { 439 for (int i = 1; i <= recipe.Additions; i++) {
440 sprintf(tmp, " %d", recipe.Addition[i-1].Time); 440 sprintf(tmp, " %d", recipe.Addition[i-1].Time);
441 TFT_print(tmp, LASTX, y); 441 TFT_print(tmp, LASTX, y);
442 } 442 }
443 _fg = TFT_WHITE; 443 _fg = TFT_WHITE;
444 TFT_print(" minuten", LASTX, y); 444 TFT_print((char *)" minuten", LASTX, y);
445 } else { 445 } else {
446 _fg = TFT_WHITE; 446 _fg = TFT_WHITE;
447 TFT_print("Geen hop toevoegingen.", 2, y); 447 TFT_print((char *)"Geen hop toevoegingen.", 2, y);
448 } 448 }
449 y += 16; 449 y += 16;
450 if (recipe.Whirlpool9) { 450 if (recipe.Whirlpool9) {
451 ShowInteger(2, y, "Whirlpool 88..100 graden", " minuten", recipe.Whirlpool9); 451 ShowInteger(2, y, (char *)"Whirlpool 88..100 graden", (char *)" minuten", recipe.Whirlpool9);
452 y += 16; 452 y += 16;
453 } 453 }
454 if (recipe.Whirlpool7) { 454 if (recipe.Whirlpool7) {
455 ShowInteger(2, y, "Whirlpool 71..77 graden", " minuten", recipe.Whirlpool7); 455 ShowInteger(2, y, (char *)"Whirlpool 71..77 graden", (char *)" minuten", recipe.Whirlpool7);
456 y += 16; 456 y += 16;
457 } 457 }
458 if (recipe.Whirlpool6) { 458 if (recipe.Whirlpool6) {
459 ShowInteger(2, y, "Whirlpool 60..66 graden", " minuten", recipe.Whirlpool6); 459 ShowInteger(2, y, (char *)"Whirlpool 60..66 graden", (char *)" minuten", recipe.Whirlpool6);
460 y += 16; 460 y += 16;
461 } 461 }
462 if (recipe.Whirlpool2) { 462 if (recipe.Whirlpool2) {
463 ShowInteger(2, y, "Whirlpool koud", " minuten", recipe.Whirlpool2); 463 ShowInteger(2, y, (char *)"Whirlpool koud", (char *)" minuten", recipe.Whirlpool2);
464 y += 16; 464 y += 16;
465 } 465 }
466 Buttons_Add( 0, 210, 70, 30, "Stop" , 0); 466 Buttons_Add( 0, 210, 70, 30, (char *)"Stop" , 0);
467 Buttons_Add(250, 210, 70, 30, "Start" , 1); 467 Buttons_Add(250, 210, 70, 30, (char *)"Start" , 1);
468 Buttons[0].dark = true; 468 Buttons[0].dark = true;
469 Buttons_Show(); 469 Buttons_Show();
470 loop = true; 470 loop = true;
471 while (loop) { 471 while (loop) {
472 switch (Buttons_Scan()) { 472 switch (Buttons_Scan()) {
487 487
488 case MAIN_AUTO_INIT2: 488 case MAIN_AUTO_INIT2:
489 _UseHLT = false; 489 _UseHLT = false;
490 _bg = TFT_BLACK; 490 _bg = TFT_BLACK;
491 TFT_fillScreen(_bg); 491 TFT_fillScreen(_bg);
492 TopMessage("Maisch water aanwezig?"); 492 TopMessage((char *)"Maisch water aanwezig?");
493 Buttons_Clear(); 493 Buttons_Clear();
494 Buttons_Add( 40, 100, 80, 40, "Ja", 0); 494 Buttons_Add( 40, 100, 80, 40, (char *)"Ja", 0);
495 Buttons_Add(200, 100, 80, 40, "Nee", 1); 495 Buttons_Add(200, 100, 80, 40, (char *)"Nee", 1);
496 Buttons_Show(); 496 Buttons_Show();
497 SoundPlay(SOUND_Prompt); 497 SoundPlay(SOUND_Prompt);
498 loop = true; 498 loop = true;
499 while (loop) { 499 while (loop) {
500 switch (Buttons_Scan()) { 500 switch (Buttons_Scan()) {
511 } 511 }
512 if (Main_Screen == MAIN_AUTO_ABORT) 512 if (Main_Screen == MAIN_AUTO_ABORT)
513 break; 513 break;
514 514
515 if ((equipment.SSR2 == SSR2_HLT_SHARE) || (equipment.SSR2 == SSR2_HLT_IND)) { 515 if ((equipment.SSR2 == SSR2_HLT_SHARE) || (equipment.SSR2 == SSR2_HLT_IND)) {
516 TopMessage("Spoelwater aanwezig?"); 516 TopMessage((char *)"Spoelwater aanwezig?");
517 SoundPlay(SOUND_Prompt); 517 SoundPlay(SOUND_Prompt);
518 loop = true; 518 loop = true;
519 while (loop) { 519 while (loop) {
520 switch (Buttons_Scan()) { 520 switch (Buttons_Scan()) {
521 case 0: loop = false; 521 case 0: loop = false;
613 driver_state->mlt_mode = MLT_MODE_PID; 613 driver_state->mlt_mode = MLT_MODE_PID;
614 xSemaphoreGive(xSemaphoreDriver); 614 xSemaphoreGive(xSemaphoreDriver);
615 } 615 }
616 MashState = Sub_Screen = MASH_WAITTEMP; 616 MashState = Sub_Screen = MASH_WAITTEMP;
617 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); 617 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen);
618 ws_server_send_text_clients("/ws", msg, strlen(msg)); 618 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg));
619 ESP_LOGI(TAG, "Mash step %d type: %s time: %d temp: %4.1f min: %4.1f max: %4.1f", 619 ESP_LOGI(TAG, "Mash step %d type: %s time: %d temp: %4.1f min: %4.1f max: %4.1f",
620 Main_Screen - MAIN_AUTO_MASH_IN, mashTypes[recipe.MashStep[Main_Screen - MAIN_AUTO_MASH_IN].Type], 620 Main_Screen - MAIN_AUTO_MASH_IN, mashTypes[recipe.MashStep[Main_Screen - MAIN_AUTO_MASH_IN].Type],
621 stageTime, stageTemp, MinMash, MaxMash); 621 stageTime, stageTemp, MinMash, MaxMash);
622 622
623 if (Main_Screen > MAIN_AUTO_MASH_IN) { 623 if (Main_Screen > MAIN_AUTO_MASH_IN) {
624 // Do not annotate before the log is open. 624 // Do not annotate before the log is open.
625 if (Main_Screen == MAIN_AUTO_MASH_OUT) { 625 if (Main_Screen == MAIN_AUTO_MASH_OUT) {
626 log_annotation(ANNOTATION_STAGE, "Uitmaischen"); 626 log_annotation(ANNOTATION_STAGE, (char *)"Uitmaischen");
627 } else { 627 } else {
628 sprintf(logline, "Maisch: %d", Main_Screen - MAIN_AUTO_MASH_IN); 628 sprintf(logline, "Maisch: %d", Main_Screen - MAIN_AUTO_MASH_IN);
629 log_annotation(ANNOTATION_STAGE, logline); 629 log_annotation(ANNOTATION_STAGE, logline);
630 } 630 }
631 } 631 }
636 sprintf(temp_buf, "Maisch stap #%d", Main_Screen - MAIN_AUTO_MASH_IN); 636 sprintf(temp_buf, "Maisch stap #%d", Main_Screen - MAIN_AUTO_MASH_IN);
637 TopMessage(temp_buf); 637 TopMessage(temp_buf);
638 } 638 }
639 if ((Main_Screen > MAIN_AUTO_MASH_IN) && (Main_Screen < MAIN_AUTO_MASH_OUT) && 639 if ((Main_Screen > MAIN_AUTO_MASH_IN) && (Main_Screen < MAIN_AUTO_MASH_OUT) &&
640 (recipe.MashStep[Main_Screen - MAIN_AUTO_MASH_IN].Type == MASHTYPE_INFUSION)) { 640 (recipe.MashStep[Main_Screen - MAIN_AUTO_MASH_IN].Type == MASHTYPE_INFUSION)) {
641 Buttons_Add( 5,120, 60, 40, "Halt", 0); 641 Buttons_Add( 5,120, 60, 40, (char *)"Halt", 0);
642 Buttons[0].dark = true; 642 Buttons[0].dark = true;
643 Buttons_Add(255,120, 60, 40, "Ok", 1); 643 Buttons_Add(255,120, 60, 40, (char *)"Ok", 1);
644 Buttons_Show(); 644 Buttons_Show();
645 _fg = TFT_WHITE; 645 _fg = TFT_WHITE;
646 _bg = TFT_BLACK; 646 _bg = TFT_BLACK;
647 TFT_setFont(DEJAVU18_FONT, NULL); 647 TFT_setFont(DEJAVU18_FONT, NULL);
648 sprintf(temp_buf, "Infuse %.1f L/%.1f C", recipe.MashStep[Main_Screen - MAIN_AUTO_MASH_IN].Infusion_amount, 648 sprintf(temp_buf, "Infuse %.1f L/%.1f C", recipe.MashStep[Main_Screen - MAIN_AUTO_MASH_IN].Infusion_amount,
649 recipe.MashStep[Main_Screen - MAIN_AUTO_MASH_IN].Infusion_temp); 649 recipe.MashStep[Main_Screen - MAIN_AUTO_MASH_IN].Infusion_temp);
650 TFT_print(temp_buf, CENTER, 135); 650 TFT_print(temp_buf, CENTER, 135);
651 SoundPlay(SOUND_Prompt); 651 SoundPlay(SOUND_Prompt);
652 MashState = Sub_Screen = MASH_INFUSE; 652 MashState = Sub_Screen = MASH_INFUSE;
653 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"%s\"}", Main_Screen, Sub_Screen, temp_buf); 653 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"%s\"}", Main_Screen, Sub_Screen, temp_buf);
654 ws_server_send_text_clients("/ws", msg, strlen(msg)); 654 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg));
655 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { 655 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) {
656 // No heating during the infusion. 656 // No heating during the infusion.
657 driver_state->mlt_sp = stageTemp; 657 driver_state->mlt_sp = stageTemp;
658 driver_state->mlt_mode = MLT_MODE_OFF; 658 driver_state->mlt_mode = MLT_MODE_OFF;
659 xSemaphoreGive(xSemaphoreDriver); 659 xSemaphoreGive(xSemaphoreDriver);
660 } 660 }
661 ESP_LOGI(TAG, "Mash infusion prompt"); 661 ESP_LOGI(TAG, "Mash infusion prompt");
662 } else { 662 } else {
663 Buttons_Add( 5, 30, 60, 40, "+sp", 0); 663 Buttons_Add( 5, 30, 60, 40, (char *)"+sp", 0);
664 Buttons_Add(255, 30, 60, 40, "-sp", 1); 664 Buttons_Add(255, 30, 60, 40, (char *)"-sp", 1);
665 Buttons_Show(); 665 Buttons_Show();
666 } 666 }
667 667
668 } else if (MashState == MASH_WAITTEMP) { 668 } else if (MashState == MASH_WAITTEMP) {
669 pumpRest = false; 669 pumpRest = false;
673 if ((temp_MLT >= stageTemp) && (Steady > 10)) { 673 if ((temp_MLT >= stageTemp) && (Steady > 10)) {
674 SoundPlay(SOUND_TempReached); 674 SoundPlay(SOUND_TempReached);
675 TempReached = true; 675 TempReached = true;
676 MashState = Sub_Screen = MASH_REST; 676 MashState = Sub_Screen = MASH_REST;
677 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); 677 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen);
678 ws_server_send_text_clients("/ws", msg, strlen(msg)); 678 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg));
679 if (Main_Screen == MAIN_AUTO_MASH_IN) { 679 if (Main_Screen == MAIN_AUTO_MASH_IN) {
680 TimerSet(0); 680 TimerSet(0);
681 } else { 681 } else {
682 if (Resume && (runtime.StageTimeLeft < stageTime)) 682 if (Resume && (runtime.StageTimeLeft < stageTime))
683 TimerSet(runtime.StageTimeLeft * 60); 683 TimerSet(runtime.StageTimeLeft * 60);
687 Resume = false; 687 Resume = false;
688 runtime.StageTimeLeft = TimeLeft / 60; 688 runtime.StageTimeLeft = TimeLeft / 60;
689 updateRuntime = true; 689 updateRuntime = true;
690 ESP_LOGI(TAG, "Mash step %d temperature reached, rest time %d", Main_Screen - MAIN_AUTO_MASH_IN, TimeLeft / 60); 690 ESP_LOGI(TAG, "Mash step %d temperature reached, rest time %d", Main_Screen - MAIN_AUTO_MASH_IN, TimeLeft / 60);
691 Buttons_Clear(); 691 Buttons_Clear();
692 Buttons_Add( 0, 120, 60, 40, "+1m", 0); 692 Buttons_Add( 0, 120, 60, 40, (char *)"+1m", 0);
693 Buttons_Add(260, 120, 60, 40, "-1m", 1); 693 Buttons_Add(260, 120, 60, 40, (char *)"-1m", 1);
694 Buttons_Show(); 694 Buttons_Show();
695 } 695 }
696 switch (Buttons_Scan()) { 696 switch (Buttons_Scan()) {
697 case 0: if (stageTemp < MaxMash) { 697 case 0: if (stageTemp < MaxMash) {
698 stageTemp += 0.25; 698 stageTemp += 0.25;
764 updateRuntime = true; 764 updateRuntime = true;
765 if ((Main_Screen == MAIN_AUTO_MASH_IN) && config.AskAdd) { 765 if ((Main_Screen == MAIN_AUTO_MASH_IN) && config.AskAdd) {
766 /* 766 /*
767 * Add Mash prompt. 767 * Add Mash prompt.
768 */ 768 */
769 log_annotation(ANNOTATION_EVENT, "Mout storten"); 769 log_annotation(ANNOTATION_EVENT, (char *)"Mout storten");
770 Buttons_Clear(); 770 Buttons_Clear();
771 Buttons_Add( 5,120, 60, 40, "Halt", 0); 771 Buttons_Add( 5,120, 60, 40, (char *)"Halt", 0);
772 Buttons[0].dark = true; 772 Buttons[0].dark = true;
773 Buttons_Add(255,120, 60, 40, "Ok", 1); 773 Buttons_Add(255,120, 60, 40, (char *)"Ok", 1);
774 Buttons_Show(); 774 Buttons_Show();
775 _fg = TFT_WHITE; 775 _fg = TFT_WHITE;
776 _bg = TFT_BLACK; 776 _bg = TFT_BLACK;
777 TFT_setFont(DEJAVU24_FONT, NULL); 777 TFT_setFont(DEJAVU24_FONT, NULL);
778 TFT_print("Mout storten?", CENTER, 135); 778 TFT_print((char *)"Mout storten?", CENTER, 135);
779 SoundPlay(SOUND_Prompt); 779 SoundPlay(SOUND_Prompt);
780 MashState = Sub_Screen = MASH_ADD; 780 MashState = Sub_Screen = MASH_ADD;
781 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"Mout storten?\"}", Main_Screen, Sub_Screen); 781 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"Mout storten?\"}", Main_Screen, Sub_Screen);
782 ws_server_send_text_clients("/ws", msg, strlen(msg)); 782 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg));
783 ESP_LOGI(TAG, "Mash add prompt"); 783 ESP_LOGI(TAG, "Mash add prompt");
784 break; 784 break;
785 } 785 }
786 if (((Main_Screen - MAIN_AUTO_MASH_IN) == LastMashStep) && config.AskIodine) { 786 if (((Main_Screen - MAIN_AUTO_MASH_IN) == LastMashStep) && config.AskIodine) {
787 /* 787 /*
788 * Iodone test prompt. 788 * Iodone test prompt.
789 */ 789 */
790 log_annotation(ANNOTATION_EVENT, "Jodium test"); 790 log_annotation(ANNOTATION_EVENT, (char *)"Jodium test");
791 TFT_fillRect(0, 120, 320, 50, TFT_BLACK); 791 TFT_fillRect(0, 120, 320, 50, TFT_BLACK);
792 Buttons_Clear(); 792 Buttons_Clear();
793 Buttons_Add( 5,120, 60, 40, "Halt", 0); 793 Buttons_Add( 5,120, 60, 40, (char *)"Halt", 0);
794 Buttons[0].dark = true; 794 Buttons[0].dark = true;
795 Buttons_Add(255,120, 60, 40, "Ok", 1); 795 Buttons_Add(255,120, 60, 40, (char *)"Ok", 1);
796 Buttons_Show(); 796 Buttons_Show();
797 _fg = TFT_WHITE; 797 _fg = TFT_WHITE;
798 _bg = TFT_BLACK; 798 _bg = TFT_BLACK;
799 TFT_setFont(DEJAVU24_FONT, NULL); 799 TFT_setFont(DEJAVU24_FONT, NULL);
800 TFT_print("Jodium test?", CENTER, 127); 800 TFT_print((char *)"Jodium test?", CENTER, 127);
801 SoundPlay(SOUND_Prompt); 801 SoundPlay(SOUND_Prompt);
802 beeped = false; 802 beeped = false;
803 TimerSet(config.IodineTime * 60); 803 TimerSet(config.IodineTime * 60);
804 MashState = Sub_Screen = MASH_IODINE; 804 MashState = Sub_Screen = MASH_IODINE;
805 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"Jodium test?\"}", Main_Screen, Sub_Screen); 805 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"Jodium test?\"}", Main_Screen, Sub_Screen);
806 ws_server_send_text_clients("/ws", msg, strlen(msg)); 806 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg));
807 ESP_LOGI(TAG, "Mash iodine test prompt"); 807 ESP_LOGI(TAG, "Mash iodine test prompt");
808 break; 808 break;
809 } 809 }
810 if ((Main_Screen == MAIN_AUTO_MASH_OUT) && config.AskRemove) { 810 if ((Main_Screen == MAIN_AUTO_MASH_OUT) && config.AskRemove) {
811 /* 811 /*
812 * Mash remove prompt. 812 * Mash remove prompt.
813 */ 813 */
814 log_annotation(ANNOTATION_EVENT, "Mout verwijderen"); 814 log_annotation(ANNOTATION_EVENT, (char *)"Mout verwijderen");
815 TFT_fillRect(0, 120, 320, 50, TFT_BLACK); 815 TFT_fillRect(0, 120, 320, 50, TFT_BLACK);
816 Buttons_Clear(); 816 Buttons_Clear();
817 Buttons_Add( 5,120, 60, 40, "Halt", 0); 817 Buttons_Add( 5,120, 60, 40, (char *)"Halt", 0);
818 Buttons[0].dark = true; 818 Buttons[0].dark = true;
819 Buttons_Add(255,120, 60, 40, "Ok", 1); 819 Buttons_Add(255,120, 60, 40, (char *)"Ok", 1);
820 Buttons_Show(); 820 Buttons_Show();
821 _fg = TFT_WHITE; 821 _fg = TFT_WHITE;
822 _bg = TFT_BLACK; 822 _bg = TFT_BLACK;
823 TFT_setFont(DEJAVU18_FONT, NULL); 823 TFT_setFont(DEJAVU18_FONT, NULL);
824 TFT_print("Mout verwijderen?", CENTER, 135); 824 TFT_print((char *)"Mout verwijderen?", CENTER, 135);
825 SoundPlay(SOUND_Prompt); 825 SoundPlay(SOUND_Prompt);
826 MashState = Sub_Screen = MASH_REMOVE; 826 MashState = Sub_Screen = MASH_REMOVE;
827 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"Mout verwijderen?\"}", Main_Screen, Sub_Screen); 827 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"Mout verwijderen?\"}", Main_Screen, Sub_Screen);
828 ws_server_send_text_clients("/ws", msg, strlen(msg)); 828 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg));
829 ESP_LOGI(TAG, "Mash remove prompt"); 829 ESP_LOGI(TAG, "Mash remove prompt");
830 break; 830 break;
831 } 831 }
832 if (Main_Screen != MAIN_AUTO_ABORT) 832 if (Main_Screen != MAIN_AUTO_ABORT)
833 Main_Screen++; 833 Main_Screen++;
878 switch (Buttons_Scan()) { 878 switch (Buttons_Scan()) {
879 case 0: Main_Screen = MAIN_AUTO_ABORT; 879 case 0: Main_Screen = MAIN_AUTO_ABORT;
880 break; 880 break;
881 case 1: MashState = Sub_Screen = MASH_WAITTEMP; 881 case 1: MashState = Sub_Screen = MASH_WAITTEMP;
882 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); 882 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen);
883 ws_server_send_text_clients("/ws", msg, strlen(msg)); 883 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg));
884 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { 884 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) {
885 // Start PID again. 885 // Start PID again.
886 driver_state->mlt_sp = stageTemp; 886 driver_state->mlt_sp = stageTemp;
887 driver_state->mlt_mode = MLT_MODE_PID; 887 driver_state->mlt_mode = MLT_MODE_PID;
888 xSemaphoreGive(xSemaphoreDriver); 888 xSemaphoreGive(xSemaphoreDriver);
889 } 889 }
890 Buttons_Clear(); 890 Buttons_Clear();
891 Buttons_Add( 5, 30, 60, 40, "+sp", 0); 891 Buttons_Add( 5, 30, 60, 40, (char *)"+sp", 0);
892 Buttons_Add(255, 30, 60, 40, "-sp", 1); 892 Buttons_Add(255, 30, 60, 40, (char *)"-sp", 1);
893 Buttons_Show(); 893 Buttons_Show();
894 TFT_fillRect(65, 120, 190, 40, TFT_BLACK); 894 TFT_fillRect(65, 120, 190, 40, TFT_BLACK);
895 log_annotation(ANNOTATION_EVENT, "Eind infusie"); 895 log_annotation(ANNOTATION_EVENT, (char *)"Eind infusie");
896 break; 896 break;
897 default: break; 897 default: break;
898 } 898 }
899 } /* MashState */ 899 } /* MashState */
900 MLT_info(71, 26, true); 900 MLT_info(71, 26, true);
950 TopMessage(recipe.Addition[runtime.HopAddition].Name); 950 TopMessage(recipe.Addition[runtime.HopAddition].Name);
951 log_annotation(ANNOTATION_EVENT, recipe.Addition[runtime.HopAddition].Name); 951 log_annotation(ANNOTATION_EVENT, recipe.Addition[runtime.HopAddition].Name);
952 SoundPlay(SOUND_AddHop); 952 SoundPlay(SOUND_AddHop);
953 runtime.HopAddition++; 953 runtime.HopAddition++;
954 } else { 954 } else {
955 TopMessage("Koken"); 955 TopMessage((char *)"Koken");
956 } 956 }
957 runtime.StageTimeLeft = TimeLeft / 60; 957 runtime.StageTimeLeft = TimeLeft / 60;
958 updateRuntime = true; 958 updateRuntime = true;
959 } 959 }
960 if (TimeLeft < 60) { 960 if (TimeLeft < 60) {
961 if (Output) { 961 if (Output) {
962 log_annotation(ANNOTATION_STAGE, "Vlamuit"); 962 log_annotation(ANNOTATION_STAGE, (char *)"Vlamuit");
963 } 963 }
964 // Flameout 964 // Flameout
965 Output = 0; 965 Output = 0;
966 } else if (driver_state->mlt_pv >= stageTemp) { 966 } else if (driver_state->mlt_pv >= stageTemp) {
967 Output = (int)((BoilPower * 255.0) / 100.0); 967 Output = (int)((BoilPower * 255.0) / 100.0);
968 if (Buttons[4].x == -1) { 968 if (Buttons[4].x == -1) {
969 Buttons_Add( 3,110, 60, 40, "+%", 4); 969 Buttons_Add( 3,110, 60, 40, (char *)"+%", 4);
970 Buttons_Add(257,110, 60, 40, "-%", 5); 970 Buttons_Add(257,110, 60, 40, (char *)"-%", 5);
971 Buttons_Show(); 971 Buttons_Show();
972 } 972 }
973 } else { 973 } else {
974 Output = 255; 974 Output = 255;
975 if (Buttons[4].x != -1) { 975 if (Buttons[4].x != -1) {
1054 stageTemp = 66.0; 1054 stageTemp = 66.0;
1055 } else { 1055 } else {
1056 stageTemp = recipe.CoolTemp; 1056 stageTemp = recipe.CoolTemp;
1057 } 1057 }
1058 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); 1058 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen);
1059 ws_server_send_text_clients("/ws", msg, strlen(msg)); 1059 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg));
1060 CoolBeep = false; 1060 CoolBeep = false;
1061 ESP_LOGI(TAG, "Start cooling from %6.2f to %4.1f", ds18b20_state->mlt_temperature, stageTemp); 1061 ESP_LOGI(TAG, "Start cooling from %6.2f to %4.1f", ds18b20_state->mlt_temperature, stageTemp);
1062 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { 1062 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) {
1063 driver_state->mlt_mode = MLT_MODE_OFF; 1063 driver_state->mlt_mode = MLT_MODE_OFF;
1064 driver_state->mlt_sp = stageTemp; 1064 driver_state->mlt_sp = stageTemp;
1065 xSemaphoreGive(xSemaphoreDriver); 1065 xSemaphoreGive(xSemaphoreDriver);
1066 } 1066 }
1067 log_annotation(ANNOTATION_STAGE, "Koelen"); 1067 log_annotation(ANNOTATION_STAGE, (char *)"Koelen");
1068 TopMessage("Koelen"); 1068 TopMessage((char *)"Koelen");
1069 MLT_info(71, 26, false); 1069 MLT_info(71, 26, false);
1070 Buttons_Add( 5, 200, 60, 40, "Stop", 0); 1070 Buttons_Add( 5, 200, 60, 40, (char *)"Stop", 0);
1071 Buttons[0].dark = true; 1071 Buttons[0].dark = true;
1072 Buttons_Add( 5, 26, 60, 40, "+1", 1); 1072 Buttons_Add( 5, 26, 60, 40, (char *)"+1", 1);
1073 Buttons_Add(255, 26, 60, 40, "-1", 2); 1073 Buttons_Add(255, 26, 60, 40, (char *)"-1", 2);
1074 /* 1074 /*
1075 * The next key is not a mistake, but we need a key entry which 1075 * The next key is not a mistake, but we need a key entry which
1076 * will later become the pump key. The keyscan routine will find 1076 * will later become the pump key. The keyscan routine will find
1077 * the original key if pressed. 1077 * the original key if pressed.
1078 */ 1078 */
1079 Buttons_Add(255, 26, 60, 40, "-1", 3); 1079 Buttons_Add(255, 26, 60, 40, (char *)"-1", 3);
1080 Buttons_Show(); 1080 Buttons_Show();
1081 } 1081 }
1082 } else { 1082 } else {
1083 /* 1083 /*
1084 * Not in prompt mode. 1084 * Not in prompt mode.
1100 /* 1100 /*
1101 * If the pump safe temperature is reached, add the control button. 1101 * If the pump safe temperature is reached, add the control button.
1102 * Redefine key number 3 if it is at the position of key 2. 1102 * Redefine key number 3 if it is at the position of key 2.
1103 */ 1103 */
1104 if ((driver_state->mlt_pv < equipment.PumpMaxTemp) && (Buttons[3].x == Buttons[2].x) &&(Buttons[3].y == Buttons[2].y)) { 1104 if ((driver_state->mlt_pv < equipment.PumpMaxTemp) && (Buttons[3].x == Buttons[2].x) &&(Buttons[3].y == Buttons[2].y)) {
1105 Buttons_Add(255, 200, 60, 40, "Pomp", 3); 1105 Buttons_Add(255, 200, 60, 40, (char *)"Pomp", 3);
1106 Buttons_Show(); 1106 Buttons_Show();
1107 } 1107 }
1108 xSemaphoreGive(xSemaphoreDriver); 1108 xSemaphoreGive(xSemaphoreDriver);
1109 } 1109 }
1110 switch (Buttons_Scan()) { 1110 switch (Buttons_Scan()) {
1121 } 1121 }
1122 xSemaphoreGive(xSemaphoreDriver); 1122 xSemaphoreGive(xSemaphoreDriver);
1123 } 1123 }
1124 break; 1124 break;
1125 1125
1126 case 0: Buttons_Add( 60, 150, 90, 40, "Stoppen", 4); 1126 case 0: Buttons_Add( 60, 150, 90, 40, (char *)"Stoppen", 4);
1127 Buttons[4].dark = true; 1127 Buttons[4].dark = true;
1128 Buttons_Add(170, 150, 90, 40, "Sorry", 5); 1128 Buttons_Add(170, 150, 90, 40, (char *)"Sorry", 5);
1129 Buttons_Show(); 1129 Buttons_Show();
1130 break; 1130 break;
1131 1131
1132 case 2: if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { 1132 case 2: if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) {
1133 if (Main_Screen == MAIN_AUTO_COOLING_H) { 1133 if (Main_Screen == MAIN_AUTO_COOLING_H) {
1212 */ 1212 */
1213 Buttons_Clear(); 1213 Buttons_Clear();
1214 TFT_fillScreen(_bg); 1214 TFT_fillScreen(_bg);
1215 Sub_Screen = 1; 1215 Sub_Screen = 1;
1216 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); 1216 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen);
1217 ws_server_send_text_clients("/ws", msg, strlen(msg)); 1217 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg));
1218 if (Main_Screen == MAIN_AUTO_WHIRLPOOL9) { 1218 if (Main_Screen == MAIN_AUTO_WHIRLPOOL9) {
1219 TimeWhirlPool = recipe.Whirlpool9; 1219 TimeWhirlPool = recipe.Whirlpool9;
1220 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { 1220 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) {
1221 driver_state->mlt_sp = 93.0; 1221 driver_state->mlt_sp = 93.0;
1222 driver_state->mlt_mode = MLT_MODE_PID; 1222 driver_state->mlt_mode = MLT_MODE_PID;
1223 xSemaphoreGive(xSemaphoreDriver); 1223 xSemaphoreGive(xSemaphoreDriver);
1224 } 1224 }
1225 TopMessage("Whirlpool 88..100"); 1225 TopMessage((char *)"Whirlpool 88..100");
1226 } else if (Main_Screen == MAIN_AUTO_WHIRLPOOL7) { 1226 } else if (Main_Screen == MAIN_AUTO_WHIRLPOOL7) {
1227 TimeWhirlPool = recipe.Whirlpool7; 1227 TimeWhirlPool = recipe.Whirlpool7;
1228 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { 1228 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) {
1229 driver_state->mlt_sp = 74.0; 1229 driver_state->mlt_sp = 74.0;
1230 driver_state->mlt_mode = MLT_MODE_PID; 1230 driver_state->mlt_mode = MLT_MODE_PID;
1231 xSemaphoreGive(xSemaphoreDriver); 1231 xSemaphoreGive(xSemaphoreDriver);
1232 } 1232 }
1233 TopMessage("Whirlpool 71..77"); 1233 TopMessage((char *)"Whirlpool 71..77");
1234 } else if (Main_Screen == MAIN_AUTO_WHIRLPOOL6) { 1234 } else if (Main_Screen == MAIN_AUTO_WHIRLPOOL6) {
1235 TimeWhirlPool = recipe.Whirlpool6; 1235 TimeWhirlPool = recipe.Whirlpool6;
1236 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { 1236 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) {
1237 driver_state->mlt_sp = 63.0; 1237 driver_state->mlt_sp = 63.0;
1238 driver_state->mlt_mode = MLT_MODE_PID; 1238 driver_state->mlt_mode = MLT_MODE_PID;
1239 xSemaphoreGive(xSemaphoreDriver); 1239 xSemaphoreGive(xSemaphoreDriver);
1240 } 1240 }
1241 TopMessage("Whirlpool 60..66"); 1241 TopMessage((char *)"Whirlpool 60..66");
1242 } else { 1242 } else {
1243 TimeWhirlPool = recipe.Whirlpool2; 1243 TimeWhirlPool = recipe.Whirlpool2;
1244 TopMessage("Koude whirlpool"); 1244 TopMessage((char *)"Koude whirlpool");
1245 } 1245 }
1246 if (Resume) { 1246 if (Resume) {
1247 TimeWhirlPool = runtime.StageTimeLeft; 1247 TimeWhirlPool = runtime.StageTimeLeft;
1248 } 1248 }
1249 1249
1252 */ 1252 */
1253 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { 1253 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) {
1254 driver_state->pump_run = (driver_state->mlt_pv < equipment.PumpMaxTemp) ? 1 : 0; 1254 driver_state->pump_run = (driver_state->mlt_pv < equipment.PumpMaxTemp) ? 1 : 0;
1255 xSemaphoreGive(xSemaphoreDriver); 1255 xSemaphoreGive(xSemaphoreDriver);
1256 } 1256 }
1257 log_annotation(ANNOTATION_STAGE, "Whirlpool"); 1257 log_annotation(ANNOTATION_STAGE, (char *)"Whirlpool");
1258 1258
1259 TimerSet(TimeWhirlPool * 60); 1259 TimerSet(TimeWhirlPool * 60);
1260 runtime.StageTimeLeft = TimeWhirlPool; 1260 runtime.StageTimeLeft = TimeWhirlPool;
1261 updateRuntime = true; 1261 updateRuntime = true;
1262 MLT_info(71, 26, false); 1262 MLT_info(71, 26, false);
1263 ESP_LOGI(TAG, "Whirlpool %d minutes, sp %4.1f", TimeWhirlPool, driver_state->mlt_sp); 1263 ESP_LOGI(TAG, "Whirlpool %d minutes, sp %4.1f", TimeWhirlPool, driver_state->mlt_sp);
1264 Buttons_Add(255, 120, 60, 40, "+1m", 0); 1264 Buttons_Add(255, 120, 60, 40, (char *)"+1m", 0);
1265 Buttons_Add( 5, 120, 60, 40, "-1m", 1); 1265 Buttons_Add( 5, 120, 60, 40, (char *)"-1m", 1);
1266 Buttons_Add(255, 200, 60, 40, "Pomp", 2); 1266 Buttons_Add(255, 200, 60, 40, (char *)"Pomp", 2);
1267 Buttons_Show(); 1267 Buttons_Show();
1268 } 1268 }
1269 } else { 1269 } else {
1270 /* 1270 /*
1271 * Not running in prompt mode, do the whirlpool. 1271 * Not running in prompt mode, do the whirlpool.

mercurial