main/recipes.c

changeset 6
e84200edc852
parent 4
6d1f512cd074
child 15
34b1eb93e71a
--- a/main/recipes.c	Sun Oct 21 23:12:08 2018 +0200
+++ b/main/recipes.c	Mon Oct 22 21:43:45 2018 +0200
@@ -497,7 +497,7 @@
 			    TFT_setFont(DEFAULT_FONT, NULL);
 			    ShowText(2, 28, "Naam", recipe.Name);
 			    ShowText(2, 44, "Code", recipe.Code);
-			    ShowInteger(162, 44, "Record", NULL, recipe.Record);
+			    ShowInteger(162, 44, "Record", NULL, r_CurrentRec);
 			    ShowInteger(2, 60, "Kooktijd", " min", recipe.BoilTime);
 			    ShowFloat(162, 60, "Koel tot", " C", recipe.CoolTemp, 2);
 			    ShowFloat(2, 76, "Maisch in", " C", recipe.MashStep[0].Temperature, 2);
@@ -580,7 +580,6 @@
 
 			    case 1:	memset(&recipe, 0, sizeof(recipe));
 					recipe.Version = 1;
-					recipe.Record = r_Records + 1;
 					sprintf(recipe.Name, "Recipe %d", r_Records + 1);
 					sprintf(recipe.Code, "00%d", r_Records + 1);
 					sprintf(recipe.MashStep[0].Name, "Mash-in");
@@ -610,7 +609,7 @@
 					r_Records++;
 					r_CurrentRec = r_Records;
 					r_UpdateRec = true;
-					ESP_LOGI(TAG, "New recipe record %d", recipe.Record);
+					ESP_LOGI(TAG, "New recipe record %d", r_CurrentRec);
 					break;
 
 			    case 2:	if ((r_CurrentRec != config.RecipeRec) && (r_Records > 1)) {
@@ -719,7 +718,7 @@
 
 			crc2 = crc32_le(0, dst, sizeof(recipe));
 			if ((crc1 != crc2) && Confirm("Gewijzigd, opslaan?", "Ja", "Nee")) {
-			    write_recipe(recipe.Record);
+			    write_recipe(r_CurrentRec);
 			}
 			Main_Screen = MAIN_TOOLS_RECIPE;
 			break;

mercurial