# HG changeset patch # User Michiel Broek # Date 1540494629 -7200 # Node ID f3451031d6c6a8fbd1fb0569422a3debadebf039 # Parent d43b393a4461cf06c370e2021bf69653cde10c6d Version 0.2.5. Removed debug console messages during recipe import. Removed old SyncDirs code to install /spiffs from the SD card since we now do this via the internet. diff -r d43b393a4461 -r f3451031d6c6 README.md --- a/README.md Thu Oct 25 20:22:18 2018 +0200 +++ b/README.md Thu Oct 25 21:10:29 2018 +0200 @@ -65,5 +65,4 @@ - Praktijktest. - Nosleep js code toevoegen. - Bij infusie (en decoctie?) maisch stappen een prompt. - - Update /spiffs via internet. diff -r d43b393a4461 -r f3451031d6c6 main/config.h --- a/main/config.h Thu Oct 25 20:22:18 2018 +0200 +++ b/main/config.h Thu Oct 25 21:10:29 2018 +0200 @@ -80,7 +80,7 @@ #include "task_http.h" -#define VERSION "0.2.4" ///< Application version +#define VERSION "0.2.5" ///< Application version /** diff -r d43b393a4461 -r f3451031d6c6 main/recipes.c --- a/main/recipes.c Thu Oct 25 20:22:18 2018 +0200 +++ b/main/recipes.c Thu Oct 25 21:10:29 2018 +0200 @@ -47,7 +47,7 @@ */ void Addition_Add(char *Name, uint8_t Type, uint16_t Time) { - printf("Addition_Add(%s, %d, %d)\n", Name, Type, Time); +// printf("Addition_Add(%s, %d, %d)\n", Name, Type, Time); if (! recipe.Additions) { // No entries yet, add the first one. sprintf(recipe.Addition[recipe.Additions].Name, "%s", Name); @@ -69,8 +69,8 @@ // A new entry and we already have some. Add it and keep the list sorted. for (int i = 0; i < recipe.Additions; i++) { if (Time > recipe.Addition[i].Time) { - printf("Insert at %d\n", i); - // Nake room +// printf("Insert at %d\n", i); + // Make room for (int j = i; j < recipe.Additions; j++) { sprintf(recipe.Addition[j+1].Name, "%s", recipe.Addition[j].Name); recipe.Addition[j+1].Type = recipe.Addition[j].Type; @@ -361,8 +361,10 @@ * Because we inserted the first infusion step and the next (original first) * step is infusion, change that one into temperature. */ - if (recipe.MashStep[1].Type == MASHTYPE_INFUSION) + if (recipe.MashStep[1].Type == MASHTYPE_INFUSION) { recipe.MashStep[1].Type = MASHTYPE_TEMPERATURE; + recipe.MashStep[1].Infusion_temp = recipe.MashStep[1].Infusion_amount = 0.0; + } if (! recipe.MashStep[7].Resttime) { // Move last mash step to position 7. @@ -388,7 +390,7 @@ } } -#if 1 +#if 0 printf("Recipe: %s\n", recipe.Name); printf("Code : %s\n", recipe.Code); printf("Boil time %d minutes\n", recipe.BoilTime); diff -r d43b393a4461 -r f3451031d6c6 main/task_sdcard.c --- a/main/task_sdcard.c Thu Oct 25 20:22:18 2018 +0200 +++ b/main/task_sdcard.c Thu Oct 25 21:10:29 2018 +0200 @@ -130,12 +130,6 @@ fprintf(f, "\"HLT_sp\":\"%.3f\",\"HLT_pv\":\"%.3f\",\"HLT_pwm\":\"%d\",", json_log->hlt_sp, json_log->hlt_pv, json_log->hlt_power); } fprintf(f, "\"Label\":\"%s\"}", json_log->time); -// printf("{\"MLT_sp\":\"%.3f\",\"MLT_pv\":\"%.3f\",\"MLT_pwm\":\"%d\",\"MLT_tr\":\"%d\",\"Pump\":\"%d\",", -// json_log->mlt_sp, json_log->mlt_pv, json_log->mlt_power, json_log->mlt_tempreached, json_log->pump_run); -// if (json_log->hlt_sp > 0.0) { -// printf("\"HLT_sp\":\"%.3f\",\"HLT_pv\":\"%.3f\",\"HLT_pwm\":\"%d\",", json_log->hlt_sp, json_log->hlt_pv, json_log->hlt_power); -// } -// printf("\"Label\":\"%s\"}\n", json_log->time); fclose(f); } } @@ -369,67 +363,6 @@ -/** - * @brief Sync directories. - * @param fromdir Source directory - * @param todir Destination directory - */ -#if 0 -void SyncDirs(char *fromdir, char *todir) -{ - char ff[64], tf[64]; - struct stat fs, ts; - int rc; - - ESP_LOGI(TAG, "SyncDirs(%s, %s)", fromdir, todir); - - DIR *dir = opendir(fromdir); - struct dirent* de = readdir(dir); - while (de) { - if (de->d_type == DT_REG) { - sprintf(ff, "%s/%s", fromdir, de->d_name); - if (stat(ff, &fs) == ESP_OK) { - - sprintf(tf, "%s/%s", todir, de->d_name); - if (stat(tf, &ts) != ESP_OK) { - ts.st_size = 0; - } - - if (fs.st_size && (fs.st_size != ts.st_size)) { - rc = FileCopy(ff, tf); - ESP_LOGI(TAG, "Copy %s to %s, %ld bytes, rc=%d", ff, todir, fs.st_size, rc); - } - } - } - de = readdir(dir); - vTaskDelay(50 / portTICK_PERIOD_MS); - } - closedir(dir); - - /* - * Now see if we need to remove files. - */ - dir = opendir(todir); - de = readdir(dir); - while (de) { - sprintf(tf, "%s/%s", todir, de->d_name); - sprintf(ff, "%s/%s", fromdir, de->d_name); - - if (stat(ff, &fs) != ESP_OK) { - if (unlink(tf) == ESP_OK) { - ESP_LOGI(TAG, "Removed %s", tf); - } - } - - de = readdir(dir); - vTaskDelay(50 / portTICK_PERIOD_MS); - } - closedir(dir); -} -#endif - - - void task_sdcard(void *pvParameter) { sdmmc_card_t* card; @@ -504,24 +437,6 @@ } else { closedir(dir); } - - -// SyncDirs("/sdcard/w", "/spiffs/w"); -// SyncDirs("/sdcard/w/js", "/spiffs/w/js"); -// SyncDirs("/sdcard/w/css", "/spiffs/w/css"); -// SyncDirs("/sdcard/w/js/modl" , "/spiffs/w/js/modl"); // -// SyncDirs("/sdcard/w/js/utils", "/spiffs/w/js/utils"); -// SyncDirs("/sdcard/w/js/zlib", "/spiffs/w/js/zlib"); -// SyncDirs("/sdcard/w/core", "/spiffs/w/core"); -// SyncDirs("/sdcard/w/core/input", "/spiffs/w/core/input"); -// SyncDirs("/sdcard/w/core/util", "/spiffs/w/core/util"); -// SyncDirs("/sdcard/w/app", "/spiffs/w/app"); -// SyncDirs("/sdcard/w/app/images", "/spiffs/w/app/images"); -// SyncDirs("/sdcard/w/app/locale", "/spiffs/w/app/locale"); -// SyncDirs("/sdcard/w/app/sounds", "/spiffs/w/app/sounds"); // -// SyncDirs("/sdcard/w/app/styles", "/spiffs/w/app/styles"); -// SyncDirs("/sdcard/fonts", "/spiffs/fonts"); // - } } else { /*