From 046e03f37dd662b4fc53995f6aaee841a6bd09f6 Mon Sep 17 00:00:00 2001 From: Andrea Gilardoni Date: Thu, 23 May 2024 16:49:09 +0200 Subject: [PATCH] fixup! added ArduinoHttpClient as CI dependency --- src/Arduino_ESP32_OTA.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Arduino_ESP32_OTA.cpp b/src/Arduino_ESP32_OTA.cpp index 76c1d02..dbc0fae 100644 --- a/src/Arduino_ESP32_OTA.cpp +++ b/src/Arduino_ESP32_OTA.cpp @@ -91,7 +91,6 @@ void Arduino_ESP32_OTA::setMagic(uint32_t magic) void Arduino_ESP32_OTA::write_byte_to_flash(uint8_t data) { Update.write(&data, 1); - _context->writtenBytes++; } int Arduino_ESP32_OTA::startDownload(const char * ota_url) @@ -103,7 +102,10 @@ int Arduino_ESP32_OTA::startDownload(const char * ota_url) int statusCode; int res; - _context = new Context(ota_url, std::bind(&Arduino_ESP32_OTA::write_byte_to_flash, this, std::placeholders::_1)); + _context = new Context(ota_url, [this](uint8_t data){ + _context->writtenBytes++; + write_byte_to_flash(data); + }); if(strcmp(_context->parsed_url.schema(), "http") == 0) { _client = new WiFiClient();