mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	fixes
This commit is contained in:
		| @@ -15,6 +15,11 @@ static const char *const TAG = "ota.arduino_esp32"; | |||||||
| std::unique_ptr<OTABackend> make_ota_backend() { return make_unique<ArduinoESP32OTABackend>(); } | std::unique_ptr<OTABackend> make_ota_backend() { return make_unique<ArduinoESP32OTABackend>(); } | ||||||
|  |  | ||||||
| OTAResponseTypes ArduinoESP32OTABackend::begin(size_t image_size) { | OTAResponseTypes ArduinoESP32OTABackend::begin(size_t image_size) { | ||||||
|  |   // Handle UPDATE_SIZE_UNKNOWN (0) which is used by web server OTA | ||||||
|  |   // where the exact firmware size is unknown due to multipart encoding | ||||||
|  |   if (image_size == 0) { | ||||||
|  |     image_size = UPDATE_SIZE_UNKNOWN; | ||||||
|  |   } | ||||||
|   bool ret = Update.begin(image_size, U_FLASH); |   bool ret = Update.begin(image_size, U_FLASH); | ||||||
|   if (ret) { |   if (ret) { | ||||||
|     return OTA_RESPONSE_OK; |     return OTA_RESPONSE_OK; | ||||||
|   | |||||||
| @@ -15,6 +15,11 @@ static const char *const TAG = "ota.arduino_libretiny"; | |||||||
| std::unique_ptr<OTABackend> make_ota_backend() { return make_unique<ArduinoLibreTinyOTABackend>(); } | std::unique_ptr<OTABackend> make_ota_backend() { return make_unique<ArduinoLibreTinyOTABackend>(); } | ||||||
|  |  | ||||||
| OTAResponseTypes ArduinoLibreTinyOTABackend::begin(size_t image_size) { | OTAResponseTypes ArduinoLibreTinyOTABackend::begin(size_t image_size) { | ||||||
|  |   // Handle UPDATE_SIZE_UNKNOWN (0) which is used by web server OTA | ||||||
|  |   // where the exact firmware size is unknown due to multipart encoding | ||||||
|  |   if (image_size == 0) { | ||||||
|  |     image_size = UPDATE_SIZE_UNKNOWN; | ||||||
|  |   } | ||||||
|   bool ret = Update.begin(image_size, U_FLASH); |   bool ret = Update.begin(image_size, U_FLASH); | ||||||
|   if (ret) { |   if (ret) { | ||||||
|     return OTA_RESPONSE_OK; |     return OTA_RESPONSE_OK; | ||||||
|   | |||||||
| @@ -17,6 +17,11 @@ static const char *const TAG = "ota.arduino_rp2040"; | |||||||
| std::unique_ptr<OTABackend> make_ota_backend() { return make_unique<ArduinoRP2040OTABackend>(); } | std::unique_ptr<OTABackend> make_ota_backend() { return make_unique<ArduinoRP2040OTABackend>(); } | ||||||
|  |  | ||||||
| OTAResponseTypes ArduinoRP2040OTABackend::begin(size_t image_size) { | OTAResponseTypes ArduinoRP2040OTABackend::begin(size_t image_size) { | ||||||
|  |   // Handle UPDATE_SIZE_UNKNOWN (0) which is used by web server OTA | ||||||
|  |   // where the exact firmware size is unknown due to multipart encoding | ||||||
|  |   if (image_size == 0) { | ||||||
|  |     image_size = UPDATE_SIZE_UNKNOWN; | ||||||
|  |   } | ||||||
|   bool ret = Update.begin(image_size, U_FLASH); |   bool ret = Update.begin(image_size, U_FLASH); | ||||||
|   if (ret) { |   if (ret) { | ||||||
|     rp2040::preferences_prevent_write(true); |     rp2040::preferences_prevent_write(true); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user