14static const char *
const TAG =
"ota.arduino_rp2040";
16std::unique_ptr<ArduinoRP2040OTABackend>
make_ota_backend() {
return make_unique<ArduinoRP2040OTABackend>(); }
24 bool ret = Update.begin(image_size, U_FLASH);
30 uint8_t error = Update.getError();
31 if (error == UPDATE_ERROR_BOOTSTRAP)
33 if (error == UPDATE_ERROR_NEW_FLASH_CONFIG)
35 if (error == UPDATE_ERROR_FLASH_CONFIG)
37 if (error == UPDATE_ERROR_SPACE)
40 ESP_LOGE(TAG,
"Begin error: %d", error);
47 this->md5_set_ =
true;
56 uint8_t error = Update.getError();
57 ESP_LOGE(TAG,
"Write error: %d", error);
65 if (Update.end(!this->md5_set_)) {
69 uint8_t error = Update.getError();
70 ESP_LOGE(TAG,
"End error: %d", error);
OTAResponseTypes begin(size_t image_size, OTAType ota_type=OTA_TYPE_UPDATE_APP)
OTAResponseTypes write(uint8_t *data, size_t len)
void set_update_md5(const char *md5)
@ OTA_RESPONSE_ERROR_WRONG_NEW_FLASH_CONFIG
@ OTA_RESPONSE_ERROR_WRONG_CURRENT_FLASH_CONFIG
@ OTA_RESPONSE_ERROR_WRITING_FLASH
@ OTA_RESPONSE_ERROR_UNSUPPORTED_OTA_TYPE
@ OTA_RESPONSE_ERROR_UPDATE_END
@ OTA_RESPONSE_ERROR_RP2040_NOT_ENOUGH_SPACE
@ OTA_RESPONSE_ERROR_UNKNOWN
@ OTA_RESPONSE_ERROR_INVALID_BOOTSTRAPPING
std::unique_ptr< ArduinoLibreTinyOTABackend > make_ota_backend()
void preferences_prevent_write(bool prevent)