FwUpdate: chunk offset overflow, no heavy work in handlers, crc 0 refused

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-13 14:30:19 +01:00
1 parent a029863d66
commit 46d33bd2b0
2 files changed
+65 -23

No files matched your search

+4 -1
View File
@@ -90,7 +90,8 @@ private:
void doVerify();
void cmdApply(uint32_t sender_timestamp, const char *arg, char *reply);
void cmdBootloader(char *reply);
uint16_t battMinMv();
uint16_t battMinMv(); // 5 reads 100 ms apart: loop() only, never a handler
const char *battGate(uint16_t mv, bool force); // NULL = ok
uint32_t received() const; // units
uint32_t units() const { return (_total + FW_OTA_UNIT - 1) / FW_OTA_UNIT; }
bool haveUnit(uint32_t u) const { return _have[u >> 3] & (1 << (u & 7)); }
@@ -124,6 +125,8 @@ private:
char _version[48] = { 0 };
char _err[64] = { 0 };
unsigned long _apply_at = 0;
bool _apply_force = false;
char _apply_err[40] = { 0 }; // why loop() refused the queued apply
static constexpr uint32_t MAX_UNITS = (0xED000 - 0x27000) / FW_OTA_UNIT + 1; // whole stage
uint8_t _have[(MAX_UNITS + 7) / 8];
};