Skip to content

Commit 4eefbe7

Browse files
Clear job.tile->busy after fetch (#114)
1 parent 3b933b7 commit 4eefbe7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/OpenStreetMap-esp32.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ bool OpenStreetMap::fetchTile(CachedTile &tile, uint32_t x, uint32_t y, uint8_t
458458

459459
currentInstance = this;
460460
currentTileBuffer = tile.buffer;
461-
tile.busy = false;
462461
const int decodeResult = png->decode(0, PNG_FAST_PALETTE);
463462
if (decodeResult != PNG_SUCCESS)
464463
{
@@ -495,6 +494,8 @@ void OpenStreetMap::tileFetcherTask(void *param)
495494
}
496495
else
497496
log_d("core %i fetched tile z=%u x=%lu, y=%lu in %lu ms", xPortGetCoreID(), job.z, job.x, job.y, millis() - startMS);
497+
498+
job.tile->busy = false;
498499
--osm->pendingJobs;
499500
}
500501
log_d("task on core %i exiting", xPortGetCoreID());

src/OpenStreetMap-esp32.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include "fonts/DejaVu9-modded.h"
4141

4242
constexpr uint16_t OSM_BGCOLOR = lgfx::color565(32, 32, 128);
43-
constexpr uint16_t OSM_TILE_TIMEOUT_MS = 1000;
43+
constexpr uint16_t OSM_TILE_TIMEOUT_MS = 500;
4444
constexpr UBaseType_t OSM_TASK_PRIORITY = 1;
4545
constexpr uint32_t OSM_TASK_STACKSIZE = 5120;
4646
constexpr uint32_t OSM_JOB_QUEUE_SIZE = 50;

0 commit comments

Comments
 (0)