mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-08 16:25:34 +00:00
Update ESP-IDF to v5.5-beta1 and add minimal ESP8266 support (#1707)
* update esp-idf * esp8266 * fix * pwm, uart and wifi fix * fix ota * fix 1m and ps * update workflow
This commit is contained in:
committed by
GitHub
parent
55ce270fef
commit
a261a71ab1
@ -38,7 +38,7 @@ uint32_t flash_read(uint32_t flash, uint32_t addr, void* buf, uint32_t size);
|
||||
#include "hal/hal_flash.h"
|
||||
#include "flash_partition_table.h"
|
||||
|
||||
#elif PLATFORM_ESPIDF
|
||||
#elif PLATFORM_ESPIDF || PLATFORM_ESP8266
|
||||
|
||||
#include "esp_system.h"
|
||||
#include "esp_ota_ops.h"
|
||||
@ -48,8 +48,16 @@ uint32_t flash_read(uint32_t flash, uint32_t addr, void* buf, uint32_t size);
|
||||
#include "nvs.h"
|
||||
#include "nvs_flash.h"
|
||||
#include "esp_wifi.h"
|
||||
#if PLATFORM_ESPIDF
|
||||
#include "esp_flash.h"
|
||||
#include "esp_pm.h"
|
||||
#include "esp_flash_spi_init.h"
|
||||
#else
|
||||
#include "esp_image_format.h"
|
||||
#include "spi_flash.h"
|
||||
#define esp_flash_read(a,b,c,d) spi_flash_read(c,b,d)
|
||||
#define OTA_WITH_SEQUENTIAL_WRITES OTA_SIZE_UNKNOWN
|
||||
#define esp_ota_abort esp_ota_end
|
||||
#endif
|
||||
|
||||
#elif PLATFORM_REALTEK
|
||||
|
||||
@ -309,7 +317,7 @@ static int http_rest_post(http_request_t* request) {
|
||||
return http_rest_post_flash(request, -1, -1);
|
||||
#elif PLATFORM_LN882H
|
||||
return http_rest_post_flash(request, -1, -1);
|
||||
#elif PLATFORM_ESPIDF
|
||||
#elif PLATFORM_ESPIDF || PLATFORM_ESP8266
|
||||
return http_rest_post_flash(request, -1, -1);
|
||||
#elif PLATFORM_REALTEK
|
||||
return http_rest_post_flash(request, 0, -1);
|
||||
@ -1603,7 +1611,6 @@ static int http_rest_post_flash(http_request_t* request, int startaddr, int maxa
|
||||
int towrite = request->bodylen;
|
||||
char* writebuf = request->bodystart;
|
||||
int writelen = request->bodylen;
|
||||
int fsize = 0;
|
||||
|
||||
ADDLOG_DEBUG(LOG_FEATURE_OTA, "OTA post len %d", request->contentLength);
|
||||
|
||||
@ -2141,7 +2148,7 @@ static int http_rest_post_flash(http_request_t* request, int startaddr, int maxa
|
||||
}
|
||||
|
||||
|
||||
#elif PLATFORM_ESPIDF
|
||||
#elif PLATFORM_ESPIDF || PLATFORM_ESP8266
|
||||
|
||||
ADDLOG_DEBUG(LOG_FEATURE_OTA, "Ota start!\r\n");
|
||||
esp_err_t err;
|
||||
@ -2151,7 +2158,7 @@ static int http_rest_post_flash(http_request_t* request, int startaddr, int maxa
|
||||
update_partition = esp_ota_get_next_update_partition(NULL);
|
||||
if(request->contentLength >= 0)
|
||||
{
|
||||
fsize = towrite = request->contentLength;
|
||||
towrite = request->contentLength;
|
||||
}
|
||||
|
||||
esp_wifi_set_ps(WIFI_PS_NONE);
|
||||
@ -2197,7 +2204,7 @@ static int http_rest_post_flash(http_request_t* request, int startaddr, int maxa
|
||||
return -1;
|
||||
}
|
||||
|
||||
ADDLOG_DEBUG(LOG_FEATURE_OTA, "OTA in progress: %.1f%%", (100 - ((float)towrite / fsize) * 100));
|
||||
ADDLOG_DEBUG(LOG_FEATURE_OTA, "Writelen %i at %i", writelen, total);
|
||||
total += writelen;
|
||||
startaddr += writelen;
|
||||
towrite -= writelen;
|
||||
@ -3289,7 +3296,7 @@ static int http_rest_get_flash(http_request_t* request, int startaddr, int len)
|
||||
res = tls_fls_read(startaddr, (uint8_t*)buffer, readlen);
|
||||
#elif PLATFORM_LN882H
|
||||
res = hal_flash_read(startaddr, readlen, (uint8_t *)buffer);
|
||||
#elif PLATFORM_ESPIDF
|
||||
#elif PLATFORM_ESPIDF || PLATFORM_ESP8266
|
||||
res = esp_flash_read(NULL, (void*)buffer, startaddr, readlen);
|
||||
#elif PLATFORM_TR6260
|
||||
res = hal_spiflash_read(startaddr, (uint8_t*)buffer, readlen);
|
||||
|
||||
Reference in New Issue
Block a user