diff --git a/src/utility/ota/OTA-unor4.cpp b/src/utility/ota/OTA-unor4.cpp index 34c417b0..e65ef501 100644 --- a/src/utility/ota/OTA-unor4.cpp +++ b/src/utility/ota/OTA-unor4.cpp @@ -29,6 +29,7 @@ #include "fsp_common_api.h" #include "r_flash_lp.h" #include "WiFiS3.h" +#include "OTA.h" /****************************************************************************** * DEFINES @@ -99,7 +100,7 @@ int unor4_onOTARequest(char const * ota_url) if ((ota_err = ota.begin("/update.bin")) != OTAUpdate::Error::None) { DEBUG_ERROR("OTAUpdate::begin() failed with %d", static_cast(ota_err)); - return static_cast(ota_err); + return (UNO_WIFI_R4_OTA_ERROR_BASE + static_cast(ota_err)); } /* Download the OTA file from the web storage location. */ @@ -107,7 +108,7 @@ int unor4_onOTARequest(char const * ota_url) if (ota_download <= 0) { DEBUG_ERROR("OTAUpdate::download() failed with %d", ota_download); - return ota_download; + return (UNO_WIFI_R4_OTA_ERROR_BASE + ota_download); } DEBUG_VERBOSE("OTAUpdate::download() %d bytes downloaded", static_cast(ota_download)); @@ -115,7 +116,7 @@ int unor4_onOTARequest(char const * ota_url) if ((ota_err = ota.verify()) != OTAUpdate::Error::None) { DEBUG_ERROR("OTAUpdate::verify() failed with %d", static_cast(ota_err)); - return static_cast(ota_err); + return (UNO_WIFI_R4_OTA_ERROR_BASE + static_cast(ota_err)); } /* Store update size and write OTA magin number */ @@ -125,7 +126,7 @@ int unor4_onOTARequest(char const * ota_url) if ((ota_err = ota.update("/update.bin")) != OTAUpdate::Error::None) { DEBUG_ERROR("OTAUpdate::update() failed with %d", static_cast(ota_err)); - return static_cast(ota_err); + return (UNO_WIFI_R4_OTA_ERROR_BASE + static_cast(ota_err)); } return static_cast(OTAUpdate::Error::None); diff --git a/src/utility/ota/OTA.h b/src/utility/ota/OTA.h index 8451e2e7..735300f9 100644 --- a/src/utility/ota/OTA.h +++ b/src/utility/ota/OTA.h @@ -32,8 +32,9 @@ * DEFINES ******************************************************************************/ -#define RP2040_OTA_ERROR_BASE (-100) -#define ESP32_OTA_ERROR_BASE (-300) +#define RP2040_OTA_ERROR_BASE (-100) +#define ESP32_OTA_ERROR_BASE (-300) +#define UNO_WIFI_R4_OTA_ERROR_BASE (-400) /****************************************************************************** * TYPEDEF