Pause NetTask during OTA update/check to avoid WiFi/TLS contention

The background task polls ADS-B, weather, and aircraft details every
few seconds on Core 0, sharing the same WiFi radio/TLS stack as the
OTA check/download. Suspected cause of repeated OTA failures. Now
suspended via NetTask::pause() for the duration of both
checkForUpdate() and performUpdate(), resumed immediately after.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Eiswolf-BG
2026-08-13 22:05:21 +02:00
parent a5b0e5404a
commit 969b0a2e19
3 changed files with 22 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
#include "logbook_files_screen.h"
#include "webui_screen.h"
#include "ota_update.h"
#include "net_task.h"
#include "location_presets_screen.h"
#include "airline_filter_screen.h"
#include "aircraft_watchlist_screen.h"
@@ -541,7 +542,9 @@ namespace {
tft.drawString(I18n::t(StringId::OTA_CHECKING), Config::SCREEN_WIDTH / 2, Config::SCREEN_HEIGHT / 2);
tft.setTextDatum(TL_DATUM);
NetTask::pause();
OtaUpdate::CheckInfo info = OtaUpdate::checkForUpdate();
NetTask::resume();
if (info.result == OtaUpdate::CheckResult::Error) {
infoScreen(tft, I18n::t(StringId::OTA_CHECK_FAILED), "", TFT_RED, I18n::t(StringId::OK));
@@ -560,7 +563,9 @@ namespace {
otaProgressTft = &tft;
tft.fillScreen(TFT_BLACK);
drawOtaProgress(0);
NetTask::pause();
bool ok = OtaUpdate::performUpdate(info.downloadUrl, drawOtaProgress);
NetTask::resume();
otaProgressTft = nullptr;
if (ok) {