Skip to content

Commit

Permalink
Adjusted the selection process of CPU cores to execute the PSRAM copy…
Browse files Browse the repository at this point in the history
… task in Panel_CVBS.
  • Loading branch information
lovyan03 committed Jan 9, 2023
1 parent 25cc0b2 commit caac1e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/lgfx/v1/platforms/esp32/Panel_CVBS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,11 @@ namespace lgfx
_push_idx = 0;
_using_idx = cache_num - 1;
prev_index = 0;
if ((uint32_t)task_pinned_core < portNUM_PROCESSORS)
if ((uint32_t)task_pinned_core >= portNUM_PROCESSORS)
{
xTaskCreatePinnedToCore(task_memcpy, "task_memcpy", 2048, this, task_priority, &_task_handle, task_pinned_core);
}
else
{
xTaskCreate(task_memcpy, "task_memcpy", 2048, this, task_priority, &_task_handle);
task_pinned_core = (xPortGetCoreID() + 1) % portNUM_PROCESSORS;
}
xTaskCreatePinnedToCore(task_memcpy, "task_memcpy", 2048, this, task_priority, &_task_handle, task_pinned_core);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lgfx/v1/platforms/esp32/Panel_CVBS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace lgfx
UBaseType_t task_priority = 25;

/// background PSRAM read task pinned core. (APP_CPU_NUM or PRO_CPU_NUM)
BaseType_t task_pinned_core = PRO_CPU_NUM;
BaseType_t task_pinned_core = -1;
};

color_depth_t setColorDepth(color_depth_t) override;
Expand Down

0 comments on commit caac1e2

Please sign in to comment.