feat(ota): defer updates when battery is low

This commit is contained in:
chenjintao
2026-08-20 17:26:11 +08:00
parent 8d3d66c45f
commit 0542aadaa4
6 changed files with 369 additions and 0 deletions
+21
View File
@@ -115,6 +115,27 @@ menu "Example Configuration"
range 2048 32768
depends on TQ_OTA_ENABLE
config TQ_OTA_MIN_BATTERY_PERCENT
int "Minimum battery percentage to start OTA"
default 20
range 0 100
depends on TQ_OTA_ENABLE && TQ_BATTERY_ENABLE
help
Defer an approved OTA update while the latest valid battery
percentage is below this threshold. Forced updates do not
bypass this safety gate. Once installation starts, percentage
changes do not cancel the in-progress update.
config TQ_OTA_POWER_RETRY_MS
int "OTA low-battery recheck interval (ms)"
default 60000
range 10000 3600000
depends on TQ_OTA_ENABLE && TQ_BATTERY_ENABLE
help
Delay before reporting the version again after an approved OTA
update is deferred because battery status is low, unavailable,
or stale. A fresh report also refreshes expiring download URLs.
endmenu
endmenu