mirror of
https://github.com/ALLFATHER-BV/wadamesh.git
synced 2026-10-24 08:22:25 +00:00
fix(map): don't paint from a backend whose swap is still deferred
The quiescence gate drops the decoded tiles and clears the dedup ring unconditionally, which is right, but it also fell through to renderMapTiles() with s_tile_fs still pointing at the old backend. On the teardown side that means probing &SD for a card that is gone -- up to five opens per tile, each paying a full sd_diskio timeout, on the loop task. Return after the invalidation when the swap could not be applied. sdHealthTick renders as soon as it lands it. Signed-off-by: Pixel Perfect <me@pixp.cc>
This commit is contained in:
1 file changed
+7
@@ -25923,6 +25923,13 @@ static void mapNoteStorageChanged() {
|
||||
for (int i = 0; i < k_tile_fetch_dedup_size; ++i) s_tile_fetch_dedup[i] = 0;
|
||||
s_tile_fetch_dedup_head = 0;
|
||||
freeMapTiles();
|
||||
#if CAP_SD || defined(TLORA_PAGER)
|
||||
// Drop the stale tiles above either way, but do not paint from a backend we
|
||||
// already know is wrong — that would read through &SD for a card that is gone
|
||||
// and pay a full SPI timeout per probe on the loop task. sdHealthTick renders
|
||||
// as soon as it lands the deferred swap.
|
||||
if (!may_swap) return;
|
||||
#endif
|
||||
if (g_lv.tabview && lv_tabview_get_tab_act(g_lv.tabview) == MAP_TAB_INDEX) renderMapTiles();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user