34 esp_ota_handle_t update_handle = 0; |
34 esp_ota_handle_t update_handle = 0; |
35 |
35 |
36 TFT_setFont(DEJAVU18_FONT, NULL); |
36 TFT_setFont(DEJAVU18_FONT, NULL); |
37 _fg = TFT_CYAN; |
37 _fg = TFT_CYAN; |
38 const esp_partition_t *running = esp_ota_get_running_partition(); |
38 const esp_partition_t *running = esp_ota_get_running_partition(); |
39 // snprintf(temp, 63, "Running part.type %d sub %d,\r\nat offset 0x%08x\r\n", |
|
40 // running->type, running->subtype, running->address); |
|
41 // TFT_print(temp, 0, LASTY); |
|
42 |
39 |
43 /* |
40 /* |
44 * Don't use https because it costs more then 100K memory. |
41 * Don't use https because it costs more then 100K memory. |
45 */ |
42 */ |
46 esp_http_client_config_t update = { |
43 esp_http_client_config_t update = { |
135 ESP_LOGE(TAG, "esp_ota_begin failed (%s)", esp_err_to_name(err)); |
132 ESP_LOGE(TAG, "esp_ota_begin failed (%s)", esp_err_to_name(err)); |
136 http_cleanup(client); |
133 http_cleanup(client); |
137 goto updateerr; |
134 goto updateerr; |
138 } |
135 } |
139 ESP_LOGI(TAG, "Continue upgrade application"); |
136 ESP_LOGI(TAG, "Continue upgrade application"); |
|
137 TFT_print((char *)"Download new version.\r\n", 0, LASTY); |
140 } else { |
138 } else { |
141 ESP_LOGE(TAG, "Received package is not fit len"); |
139 ESP_LOGE(TAG, "Received package is not fit len"); |
142 http_cleanup(client); |
140 http_cleanup(client); |
143 goto updateerr; |
141 goto updateerr; |
144 } |
142 } |