main/updates.c

changeset 54
7b134c27fadb
parent 42
c6a1a6ca5437
child 67
4badc7e7d629
--- a/main/updates.c	Sun May 19 21:05:07 2019 +0200
+++ b/main/updates.c	Mon Jul 01 23:15:49 2019 +0200
@@ -82,7 +82,7 @@
 	goto updateerr;
     }
 
-    TFT_print("Begin download.\r\n", 0, LASTY);
+    TFT_print((char *)"Begin download.\r\n", 0, LASTY);
     ESP_LOGI(TAG, "Download update %s size %d", update.url, content_length);
     int binary_file_length = 0;
     /*deal with all receive packet*/
@@ -117,7 +117,7 @@
 
     if (esp_partition_check_identity(esp_ota_get_running_partition(), update_partition) == true) {
 	ESP_LOGI(TAG, "Already the latest version");
-	TFT_print("Already the latest version.\r\n", LASTX, LASTY);
+	TFT_print((char *)"Already the latest version.\r\n", LASTX, LASTY);
 	goto updateok;
     }
 
@@ -131,14 +131,14 @@
     }
 
     ESP_LOGI(TAG, "Prepare to restart system!");
-    TFT_print("Rebooting ...", 0, LASTY);
+    TFT_print((char *)"Rebooting ...", 0, LASTY);
     vTaskDelay(1000 / portTICK_PERIOD_MS);
     esp_restart();
     return ;
 
 updateerr:
     _fg = TFT_RED;
-    TFT_print("Error\r\n", 0, LASTY);
+    TFT_print((char *)"Error\r\n", 0, LASTY);
 
 updateok:
     vTaskDelay(3000 / portTICK_PERIOD_MS);
@@ -249,20 +249,20 @@
 
     TFT_setFont(DEJAVU18_FONT, NULL);
     _fg = TFT_CYAN;
-    TFT_print("Update /spiffs ", 0, 25);
+    TFT_print((char *)"Update /spiffs ", 0, 25);
 
     rc = rename("/spiffs/version.txt", "/spiffs/version.old");
     if ((rc != 0) && (errno == ENOENT)) {
 	/* No old file. */
 	ESP_LOGI(TAG, "No old /spiffs/version.txt");
 	/* Download, install old and new */
-	DownloadSpiffs("version.txt");
+	DownloadSpiffs((char *)"version.txt");
 	rename("/spiffs/version.txt", "/spiffs/version.old");
-	DownloadSpiffs("version.txt");
+	DownloadSpiffs((char *)"version.txt");
 	goto spiffs_update;
     }
 
-    if (DownloadSpiffs("version.txt") < 0)
+    if (DownloadSpiffs((char *)"version.txt") < 0)
 	goto spiffs_error;
 
     /* Compare spiffs/version.old and /spiffs/version.txt */
@@ -280,7 +280,7 @@
     }
     if (strcmp(v1, v2) == 0) {
 	ESP_LOGI(TAG, "/spiffs is up to date");
-	TFT_print("Ok\r\n", LASTX, LASTY);
+	TFT_print((char *)"Ok\r\n", LASTX, LASTY);
 	unlink("/spiffs/version.old");
 	return;
     }
@@ -290,7 +290,7 @@
      * Run the update, get the filelist.
      */
     ESP_LOGI(TAG, "Full /spiffs update");
-    rc = DownloadSpiffs("files.list");
+    rc = DownloadSpiffs((char *)"files.list");
     if (rc < 0) {
 	unlink("/spiffs/version.txt");
 	rename("/spiffs/version.old", "/spiffs/version.txt");	// So next time we try again.
@@ -310,12 +310,12 @@
     }
     fclose(f);
     unlink("/spiffs/version.old");
-    TFT_print("updated\r\n", LASTX, LASTY);
+    TFT_print((char *)"updated\r\n", LASTX, LASTY);
     return;
 
 spiffs_error:
     _fg = TFT_RED;
-    TFT_print("error\r\n", LASTX, LASTY);
+    TFT_print((char *)"error\r\n", LASTX, LASTY);
 
 }
 
@@ -330,7 +330,7 @@
 	case MAIN_TOOLS_UPDATES:
 			_bg = TFT_BLACK;
 			TFT_fillScreen(_bg);
-			TopMessage("Update");
+			TopMessage((char *)"Update");
 			break;
 
 	default:	break;

mercurial