将项目版本更新至1.5.9,优化内存使用,增加主任务栈大小至8192,优化固件升级流程,重构主循环为MainEventLoop,添加新版本检查功能,更新音频编解码器的DMA配置常量。

This commit is contained in:
Terrence
2025-04-13 11:47:15 +08:00
parent 4ef6ef3552
commit 78d7b40914
20 changed files with 125 additions and 113 deletions

View File

@@ -58,15 +58,15 @@ bool Ota::CheckVersion() {
http->SetHeader("Accept-Language", Lang::CODE);
http->SetHeader("Content-Type", "application/json");
std::string post_data = board.GetJson();
std::string method = post_data.length() > 0 ? "POST" : "GET";
if (!http->Open(method, check_version_url_, post_data)) {
std::string data = board.GetJson();
std::string method = data.length() > 0 ? "POST" : "GET";
if (!http->Open(method, check_version_url_, data)) {
ESP_LOGE(TAG, "Failed to open HTTP connection");
delete http;
return false;
}
auto response = http->GetBody();
data = http->GetBody();
http->Close();
delete http;
@@ -74,7 +74,7 @@ bool Ota::CheckVersion() {
// Parse the JSON response and check if the version is newer
// If it is, set has_new_version_ to true and store the new version and URL
cJSON *root = cJSON_Parse(response.c_str());
cJSON *root = cJSON_Parse(data.c_str());
if (root == NULL) {
ESP_LOGE(TAG, "Failed to parse JSON response");
return false;