@geastack/targets 0.1.83 → 0.1.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/build-config.json +481 -0
- package/package.json +8 -7
- package/targets/cmake/gea_build_config.cmake +12 -0
- package/targets/esp32/chip_bindings/audio/es8311.cpp +30 -8
- package/targets/esp32/display.cpp +57 -28
- package/targets/esp32/gea_framework.cmake +25 -3
- package/targets/esp32/memory_config.h +7 -0
- package/targets/esp32/services/app_runner.cpp +13 -4
- package/targets/esp32/services/device_control.cpp +82 -27
- package/targets/esp32/services/frame_scheduler.cpp +117 -2
- package/targets/esp32-p4-m5stack-tab5/main/CMakeLists.txt +2 -1
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/CMakeLists.txt +2 -1
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/CMakeLists.txt +2 -1
- package/targets/esp32-s3-elecrow-rotary-2.1/main/CMakeLists.txt +2 -0
- package/targets/esp32-s3-epaper-1.54/main/CMakeLists.txt +3 -1
- package/targets/esp32-s3-lilygo-t-display-s3-long/CMakeLists.txt +1 -1
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/CMakeLists.txt +1 -24
- package/targets/esp32-s3-touch-amoled-1.75/main/CMakeLists.txt +2 -1
- package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +10 -61
- package/targets/esp32-s3-touch-amoled-1.8/main/panel_reset.cpp +54 -0
- package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +1 -42
- package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +11 -128
- package/targets/rp2350-tufty-2350/CMakeLists.txt +6 -7
- package/targets/rp2350-waveshare-touch-amoled-2.41/CMakeLists.txt +4 -0
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
#include "freertos/task.h"
|
|
42
42
|
#include "freertos/idf_additions.h"
|
|
43
43
|
#include "ui/state_init.h"
|
|
44
|
+
#include "ui/dirty_regions.h"
|
|
44
45
|
|
|
45
46
|
#if GEA_BOARD_PREPARE_DISPLAY_PANEL
|
|
46
47
|
namespace gea::platform::board
|
|
@@ -267,19 +268,12 @@ namespace gea::platform::esp32::display
|
|
|
267
268
|
constexpr std::uint16_t kConsoleBackground = pixel::fromRgb565(0x0000);
|
|
268
269
|
constexpr int kFlushChunkDefault = GEA_EMBEDDED_DISPLAY_FLUSH_CHUNK_MAX;
|
|
269
270
|
constexpr int kFlushChunkLimit = GEA_EMBEDDED_DISPLAY_FLUSH_CHUNK_LIMIT;
|
|
270
|
-
//
|
|
271
|
-
//
|
|
272
|
-
//
|
|
273
|
-
//
|
|
274
|
-
//
|
|
275
|
-
// RM69080/RM690B0 windows require an even first row and an even row count.
|
|
276
|
-
// clampAndAlign aligns the outer rect, but a one-row fallback would split it
|
|
277
|
-
// into invalid windows. Prefer a two-row, one-deep pipeline if RAM is tight.
|
|
278
|
-
#if GEA_EMBEDDED_RM690B0_PANEL
|
|
271
|
+
// Preserve the even-row windows used by the QSPI AMOLED path, including
|
|
272
|
+
// under Wi-Fi memory pressure. CO5300 and RM69080/RM690B0 reject one-row
|
|
273
|
+
// windows. Aligning only the outer dirty rectangle is insufficient: every
|
|
274
|
+
// independently addressed DMA chunk must also contain an even row count.
|
|
275
|
+
// Two rows, one-deep is the smallest safe fallback (1640 bytes at 410 px).
|
|
279
276
|
constexpr int kFlushChunkMin = 2;
|
|
280
|
-
#else
|
|
281
|
-
constexpr int kFlushChunkMin = 1;
|
|
282
|
-
#endif
|
|
283
277
|
static_assert(kFlushChunkLimit >= kFlushChunkMin, "flush limit is below the panel minimum");
|
|
284
278
|
// Leave enough DMA-capable internal RAM for the WiFi driver to receive a
|
|
285
279
|
// packet after the display pipeline is allocated. On the 2.06-inch S3 board,
|
|
@@ -1315,6 +1309,15 @@ namespace gea::platform::esp32::display
|
|
|
1315
1309
|
const int width = x1 - x0 + 1;
|
|
1316
1310
|
const int totalRows = y1 - y0 + 1;
|
|
1317
1311
|
|
|
1312
|
+
#if GEA_EMBEDDED_RM690B0_PANEL && !GEA_EMBEDDED_DISPLAY_CO5300_FRAMEBUFFER_CS_HELD_STREAM && \
|
|
1313
|
+
!GEA_EMBEDDED_DISPLAY_CO5300_FRAMEBUFFER_STREAM_FLUSH && !GEA_EMBEDDED_DISPLAY_CO5300_STREAM_FLUSH
|
|
1314
|
+
// Keep separate panel windows, but rasterize the alternate slot while
|
|
1315
|
+
// the previous band transmits. A pending resize must drain first.
|
|
1316
|
+
const bool deferEntryDrain = raster && flushQueueDepth_ > 1 && !g_flushBudgetDirty;
|
|
1317
|
+
#else
|
|
1318
|
+
constexpr bool deferEntryDrain = false;
|
|
1319
|
+
#endif
|
|
1320
|
+
|
|
1318
1321
|
// Drain any tail DMA left in flight by a prior flushFramebufferRectFrom
|
|
1319
1322
|
// that returned with waitAtEnd=false. Cheap (semaphore takes return
|
|
1320
1323
|
// immediately) when nothing is pending. Must run before setWindow so
|
|
@@ -1323,7 +1326,7 @@ namespace gea::platform::esp32::display
|
|
|
1323
1326
|
// rect — that's what capped the fused path at 35fps.
|
|
1324
1327
|
setFlushStage(FlushStage::WaitComplete, 0);
|
|
1325
1328
|
const int64_t entryWaitStartUs = esp_timer_get_time();
|
|
1326
|
-
if (!waitForFlushCompleteSpin())
|
|
1329
|
+
if (!deferEntryDrain && !waitForFlushCompleteSpin())
|
|
1327
1330
|
{
|
|
1328
1331
|
setFlushStage(FlushStage::Idle, 0);
|
|
1329
1332
|
return false;
|
|
@@ -1403,12 +1406,21 @@ namespace gea::platform::esp32::display
|
|
|
1403
1406
|
#endif
|
|
1404
1407
|
|
|
1405
1408
|
#if (GEA_EMBEDDED_DISPLAY_CO5300_FRAMEBUFFER_STREAM_FLUSH || GEA_EMBEDDED_DISPLAY_CO5300_STREAM_FLUSH) && \
|
|
1409
|
+
!GEA_EMBEDDED_DISPLAY_CO5300_FRAMEBUFFER_CS_HELD_STREAM && \
|
|
1406
1410
|
GEA_EMBEDDED_DISPLAY_CO5300_STREAM_PACE_CHUNKS > 0
|
|
1407
1411
|
int streamChunksSincePace = 0;
|
|
1408
1412
|
#endif
|
|
1409
|
-
|
|
1413
|
+
// Partial-width windows fit more rows in the same DMA slot. Preserve
|
|
1414
|
+
// the app's requested row limit and the panel's two-row alignment.
|
|
1415
|
+
const int packedChunkRows = [&] {
|
|
1416
|
+
const int fits = flushBufferCapacity_ / width;
|
|
1417
|
+
const int requested = normalizeFlushChunkRows(requestedFlushChunkRows_);
|
|
1418
|
+
const int rows = fits < requested ? fits : requested;
|
|
1419
|
+
return rows - rows % kFlushChunkMin;
|
|
1420
|
+
}();
|
|
1421
|
+
for (int row = y0; row <= y1; row += packedChunkRows)
|
|
1410
1422
|
{
|
|
1411
|
-
int chunkRows =
|
|
1423
|
+
int chunkRows = packedChunkRows;
|
|
1412
1424
|
if (row + chunkRows > y1 + 1)
|
|
1413
1425
|
chunkRows = y1 - row + 1;
|
|
1414
1426
|
if (chunkRows <= 0)
|
|
@@ -1470,6 +1482,21 @@ namespace gea::platform::esp32::display
|
|
|
1470
1482
|
flushStats_.byteSwapUs += esp_timer_get_time() - byteSwapStartUs;
|
|
1471
1483
|
#endif
|
|
1472
1484
|
|
|
1485
|
+
if (deferEntryDrain)
|
|
1486
|
+
{
|
|
1487
|
+
// This slot is reserved but not submitted. Only earlier submissions
|
|
1488
|
+
// must finish before this band's CASET/RASET/RAMWR can be issued.
|
|
1489
|
+
const int64_t pendingStartUs = esp_timer_get_time();
|
|
1490
|
+
if (!waitForFlushCompleteSpin(4000, 1))
|
|
1491
|
+
{
|
|
1492
|
+
xSemaphoreGive(flushSlots_);
|
|
1493
|
+
setFlushStage(FlushStage::Idle, 0);
|
|
1494
|
+
return false;
|
|
1495
|
+
}
|
|
1496
|
+
const int64_t waitUs = esp_timer_get_time() - pendingStartUs;
|
|
1497
|
+
flushStats_.completeWaitUs += waitUs;
|
|
1498
|
+
flushStats_.chunkWaitUs += waitUs;
|
|
1499
|
+
}
|
|
1473
1500
|
const int64_t txStartUs = esp_timer_get_time();
|
|
1474
1501
|
setFlushStage(FlushStage::Tx, row);
|
|
1475
1502
|
#if GEA_EMBEDDED_DISPLAY_CO5300_FRAMEBUFFER_CS_HELD_STREAM
|
|
@@ -1515,6 +1542,7 @@ namespace gea::platform::esp32::display
|
|
|
1515
1542
|
}
|
|
1516
1543
|
|
|
1517
1544
|
#if (GEA_EMBEDDED_DISPLAY_CO5300_FRAMEBUFFER_STREAM_FLUSH || GEA_EMBEDDED_DISPLAY_CO5300_STREAM_FLUSH) && \
|
|
1545
|
+
!GEA_EMBEDDED_DISPLAY_CO5300_FRAMEBUFFER_CS_HELD_STREAM && \
|
|
1518
1546
|
GEA_EMBEDDED_DISPLAY_CO5300_STREAM_PACE_CHUNKS > 0
|
|
1519
1547
|
if (streamFlush)
|
|
1520
1548
|
{
|
|
@@ -1587,7 +1615,10 @@ namespace gea::platform::esp32::display
|
|
|
1587
1615
|
// panel — verified on-device 2026-07-08).
|
|
1588
1616
|
setFlushStage(FlushStage::WaitComplete, y1);
|
|
1589
1617
|
const int64_t waitStartUs = esp_timer_get_time();
|
|
1590
|
-
|
|
1618
|
+
// Two 64-row DMA chunks can exceed 2 ms at 80 MHz QSPI.
|
|
1619
|
+
// Match the slot-wait budget so a normal tail does not fall back to
|
|
1620
|
+
// a scheduler wakeup just before DMA completes.
|
|
1621
|
+
const bool ok = waitForFlushCompleteSpin(4000);
|
|
1591
1622
|
closeCsHeldStream();
|
|
1592
1623
|
flushStats_.completeWaitUs += esp_timer_get_time() - waitStartUs;
|
|
1593
1624
|
setFlushStage(FlushStage::Idle, 0);
|
|
@@ -1749,7 +1780,7 @@ namespace gea::platform::esp32::display
|
|
|
1749
1780
|
// overlap; flushing each separately re-sends that overlap every frame
|
|
1750
1781
|
// (~2.5x pixel inflation). Merging flushes each pixel once. Pad-then-coalesce,
|
|
1751
1782
|
// not coalesce-then-pad, so the pad participates in the merge.
|
|
1752
|
-
constexpr int kFlushMergeCap =
|
|
1783
|
+
constexpr int kFlushMergeCap = gea::embedded::ui::DirtyRegions::kMaxRects;
|
|
1753
1784
|
present::Rect win[kFlushMergeCap];
|
|
1754
1785
|
int n = 0;
|
|
1755
1786
|
for (int i = 0; i < count; i++)
|
|
@@ -1787,7 +1818,7 @@ namespace gea::platform::esp32::display
|
|
|
1787
1818
|
else if (n > 0)
|
|
1788
1819
|
win[n - 1] = present::unite(win[n - 1], w); // overflow: fold into last
|
|
1789
1820
|
}
|
|
1790
|
-
// Greedy merge of overlapping windows until stable
|
|
1821
|
+
// Greedy merge of overlapping windows until stable.
|
|
1791
1822
|
bool changed = true;
|
|
1792
1823
|
while (changed)
|
|
1793
1824
|
{
|
|
@@ -2571,7 +2602,7 @@ namespace gea::platform::esp32::display
|
|
|
2571
2602
|
}
|
|
2572
2603
|
|
|
2573
2604
|
// Then grow to the board's profile immediately, instead of leaving that to
|
|
2574
|
-
// start(). The floor above is a
|
|
2605
|
+
// start(). The floor above is a 2-row, 1-DEEP pipeline, and 1-deep is not
|
|
2575
2606
|
// merely slower: it disables the color-stream path (which requires depth >= 2)
|
|
2576
2607
|
// and the rotated flush then times out waiting for a slot, so the panel paints
|
|
2577
2608
|
// NOTHING while the pipeline sits there. An app whose own native bring-up
|
|
@@ -3040,9 +3071,7 @@ namespace gea::platform::esp32::display
|
|
|
3040
3071
|
rows = kFlushChunkMin;
|
|
3041
3072
|
if (rows > kFlushChunkLimit)
|
|
3042
3073
|
rows = kFlushChunkLimit;
|
|
3043
|
-
#if GEA_EMBEDDED_RM690B0_PANEL
|
|
3044
3074
|
rows &= ~1;
|
|
3045
|
-
#endif
|
|
3046
3075
|
return rows;
|
|
3047
3076
|
}
|
|
3048
3077
|
|
|
@@ -3105,13 +3134,13 @@ namespace gea::platform::esp32::display
|
|
|
3105
3134
|
return true;
|
|
3106
3135
|
}
|
|
3107
3136
|
|
|
3108
|
-
bool waitForFlushComplete()
|
|
3137
|
+
bool waitForFlushComplete(int reservedSlots = 0)
|
|
3109
3138
|
{
|
|
3110
|
-
if (!flushSlots_ || flushQueueDepth_ <=
|
|
3139
|
+
if (!flushSlots_ || flushQueueDepth_ <= reservedSlots)
|
|
3111
3140
|
return true;
|
|
3112
3141
|
|
|
3113
3142
|
int taken = 0;
|
|
3114
|
-
for (int i = 0; i < flushQueueDepth_; i++)
|
|
3143
|
+
for (int i = 0; i < flushQueueDepth_ - reservedSlots; i++)
|
|
3115
3144
|
{
|
|
3116
3145
|
if (xSemaphoreTake(flushSlots_, pdMS_TO_TICKS(1000)) != pdTRUE)
|
|
3117
3146
|
{
|
|
@@ -3134,17 +3163,17 @@ namespace gea::platform::esp32::display
|
|
|
3134
3163
|
// tiny tail DMAs this drain waits on (a few chunks), polling returns within the real
|
|
3135
3164
|
// ~35-150us completion time. The blocking fallback keeps the cross-core safety net
|
|
3136
3165
|
// for an unexpectedly long drain without spinning a core indefinitely.
|
|
3137
|
-
bool waitForFlushCompleteSpin(int64_t spinBudgetUs = 2000)
|
|
3166
|
+
bool waitForFlushCompleteSpin(int64_t spinBudgetUs = 2000, int reservedSlots = 0)
|
|
3138
3167
|
{
|
|
3139
|
-
if (!flushSlots_ || flushQueueDepth_ <=
|
|
3168
|
+
if (!flushSlots_ || flushQueueDepth_ <= reservedSlots)
|
|
3140
3169
|
return true;
|
|
3141
3170
|
const int64_t start = esp_timer_get_time();
|
|
3142
3171
|
while (esp_timer_get_time() - start < spinBudgetUs)
|
|
3143
3172
|
{
|
|
3144
|
-
if (uxSemaphoreGetCount(flushSlots_) >= static_cast<UBaseType_t>(flushQueueDepth_))
|
|
3173
|
+
if (uxSemaphoreGetCount(flushSlots_) >= static_cast<UBaseType_t>(flushQueueDepth_ - reservedSlots))
|
|
3145
3174
|
return true;
|
|
3146
3175
|
}
|
|
3147
|
-
return waitForFlushComplete();
|
|
3176
|
+
return waitForFlushComplete(reservedSlots);
|
|
3148
3177
|
}
|
|
3149
3178
|
|
|
3150
3179
|
esp_err_t tryConfigureFlushPipelineCandidate(int chunkRows, int depth, int targetRows, int targetDepth)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
include("${CMAKE_CURRENT_LIST_DIR}/../cmake/gea_build_config.cmake")
|
|
1
2
|
# Shared geastack framework resolution for every esp32 board target.
|
|
2
3
|
#
|
|
3
4
|
# Requires GEA_EMBEDDED_ROOT to be set by the includer (the board's main
|
|
@@ -215,7 +216,7 @@ list(REMOVE_ITEM GEA_FW_CXX_SOURCES ${GEA_FW_APP_SENSITIVE_SOURCES})
|
|
|
215
216
|
# The direct-canvas profiling apps intentionally use a small framework slice.
|
|
216
217
|
# Reproduce that slice in the stable component instead of compiling the normal
|
|
217
218
|
# framework and relying on the linker to discard it.
|
|
218
|
-
if(
|
|
219
|
+
if(GEA_APP_CANVAS_ONLY)
|
|
219
220
|
set(GEA_FW_CXX_SOURCES
|
|
220
221
|
"${GEA_ENGINE}/ui/canvas_element.cpp"
|
|
221
222
|
"${GEA_ENGINE}/canvas.cpp"
|
|
@@ -299,8 +300,29 @@ function(gea_framework_inherit_build_settings)
|
|
|
299
300
|
# main is a static archive, so PRIVATE link options stop at the archive and
|
|
300
301
|
# never reach the final executable link. Publish the rescan group through
|
|
301
302
|
# its link interface so the ELF linker actually sees it.
|
|
302
|
-
|
|
303
|
-
|
|
303
|
+
if(GEA_APP_CANVAS_ONLY)
|
|
304
|
+
# The small canvas graph can first pull app_main/display from the late
|
|
305
|
+
# framework rescan, after both the generated app and SDK drivers were
|
|
306
|
+
# visited. Rescan the selected components together, including the app.
|
|
307
|
+
# This extracts only referenced members, unlike --whole-archive.
|
|
308
|
+
idf_build_get_property(_gea_components BUILD_COMPONENTS)
|
|
309
|
+
set(_gea_rescan "${GEATSC_ARCHIVE}")
|
|
310
|
+
foreach(_gea_component IN LISTS _gea_components)
|
|
311
|
+
idf_component_get_property(_gea_lib ${_gea_component} COMPONENT_LIB)
|
|
312
|
+
if(TARGET ${_gea_lib})
|
|
313
|
+
get_target_property(_gea_lib_type ${_gea_lib} TYPE)
|
|
314
|
+
if(_gea_lib_type STREQUAL "STATIC_LIBRARY")
|
|
315
|
+
list(APPEND _gea_rescan "$<TARGET_FILE:${_gea_lib}>")
|
|
316
|
+
endif()
|
|
317
|
+
endif()
|
|
318
|
+
endforeach()
|
|
319
|
+
list(JOIN _gea_rescan "$<COMMA>" _gea_rescan_args)
|
|
320
|
+
target_link_libraries(${COMPONENT_LIB} INTERFACE
|
|
321
|
+
"-Wl$<COMMA>--start-group$<COMMA>${_gea_rescan_args}$<COMMA>--end-group")
|
|
322
|
+
else()
|
|
323
|
+
target_link_libraries(${COMPONENT_LIB} INTERFACE
|
|
324
|
+
"-Wl$<COMMA>--start-group$<COMMA>${CMAKE_BINARY_DIR}/esp-idf/main/libmain.a$<COMMA>${CMAKE_BINARY_DIR}/esp-idf/gea_framework/libgea_framework.a$<COMMA>--end-group")
|
|
325
|
+
endif()
|
|
304
326
|
|
|
305
327
|
endfunction()
|
|
306
328
|
|
|
@@ -24,6 +24,13 @@
|
|
|
24
24
|
#define GEA_EMBEDDED_GEA_INIT_TASK_STACK_BYTES 65536
|
|
25
25
|
#endif
|
|
26
26
|
|
|
27
|
+
// A task that uses floating point can be pinned implicitly by FreeRTOS. Apps
|
|
28
|
+
// with asymmetric real-time work can choose an initialization core explicitly
|
|
29
|
+
// so first-use scheduling does not change startup latency between boots.
|
|
30
|
+
#ifndef GEA_EMBEDDED_GEA_INIT_TASK_CORE
|
|
31
|
+
#define GEA_EMBEDDED_GEA_INIT_TASK_CORE -1
|
|
32
|
+
#endif
|
|
33
|
+
|
|
27
34
|
#ifndef GEA_EMBEDDED_APP_FRAME_TASK_STACK_WORDS
|
|
28
35
|
#define GEA_EMBEDDED_APP_FRAME_TASK_STACK_WORDS 3072
|
|
29
36
|
#endif
|
|
@@ -29,6 +29,11 @@ namespace {
|
|
|
29
29
|
constexpr const char *kTag = "gea_esp32_app";
|
|
30
30
|
|
|
31
31
|
constexpr int kGeaAppInitTaskStack = GEA_EMBEDDED_GEA_INIT_TASK_STACK_BYTES;
|
|
32
|
+
static_assert(GEA_EMBEDDED_GEA_INIT_TASK_CORE >= -1 &&
|
|
33
|
+
GEA_EMBEDDED_GEA_INIT_TASK_CORE < portNUM_PROCESSORS,
|
|
34
|
+
"Gea initialization core must be -1 or an available CPU");
|
|
35
|
+
constexpr BaseType_t kGeaAppInitTaskCore = GEA_EMBEDDED_GEA_INIT_TASK_CORE < 0
|
|
36
|
+
? tskNO_AFFINITY : GEA_EMBEDDED_GEA_INIT_TASK_CORE;
|
|
32
37
|
|
|
33
38
|
#if GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG && CONFIG_HEAP_TRACING_STANDALONE
|
|
34
39
|
constexpr std::size_t kAppInitHeapTraceRecords = 1024;
|
|
@@ -108,11 +113,13 @@ void logCurrentTaskStack(const char *stage, int stackBytes)
|
|
|
108
113
|
{
|
|
109
114
|
TaskHandle_t currentTask = xTaskGetCurrentTaskHandle();
|
|
110
115
|
ESP_LOGI(kTag,
|
|
111
|
-
"stack probe [%s] task=%s stack_arg=%d hwm=%u",
|
|
116
|
+
"stack probe [%s] task=%s stack_arg=%d hwm=%u core=%d affinity=%d",
|
|
112
117
|
stage ? stage : "?",
|
|
113
118
|
currentTask ? pcTaskGetName(currentTask) : "?",
|
|
114
119
|
stackBytes,
|
|
115
|
-
static_cast<unsigned>(uxTaskGetStackHighWaterMark(currentTask))
|
|
120
|
+
static_cast<unsigned>(uxTaskGetStackHighWaterMark(currentTask)),
|
|
121
|
+
xPortGetCoreID(),
|
|
122
|
+
static_cast<int>(xTaskGetCoreID(currentTask)));
|
|
116
123
|
}
|
|
117
124
|
#endif
|
|
118
125
|
|
|
@@ -200,24 +207,26 @@ bool runGeaInitTask(int width, int height)
|
|
|
200
207
|
// only touched by FreeRTOS context save/restore (word-aligned) and user
|
|
201
208
|
// code (via cache, which doesn't care about cap flags), so dropping the
|
|
202
209
|
// 8BIT requirement here is safe.
|
|
203
|
-
created =
|
|
210
|
+
created = xTaskCreatePinnedToCoreWithCaps(
|
|
204
211
|
&GeaInitTask::run,
|
|
205
212
|
"gea_init",
|
|
206
213
|
kGeaAppInitTaskStack,
|
|
207
214
|
&args,
|
|
208
215
|
5,
|
|
209
216
|
&task,
|
|
217
|
+
kGeaAppInitTaskCore,
|
|
210
218
|
MALLOC_CAP_SPIRAM);
|
|
211
219
|
ESP_LOGI("app_runner", "gea_init SPIRAM create: %s", created == pdPASS ? "ok" : "FAIL");
|
|
212
220
|
#endif
|
|
213
221
|
if (created != pdPASS) {
|
|
214
|
-
created =
|
|
222
|
+
created = xTaskCreatePinnedToCoreWithCaps(
|
|
215
223
|
&GeaInitTask::run,
|
|
216
224
|
"gea_init",
|
|
217
225
|
kGeaAppInitTaskStack,
|
|
218
226
|
&args,
|
|
219
227
|
5,
|
|
220
228
|
&task,
|
|
229
|
+
kGeaAppInitTaskCore,
|
|
221
230
|
MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
|
222
231
|
ESP_LOGI("app_runner", "gea_init INTERNAL create: %s", created == pdPASS ? "ok" : "FAIL");
|
|
223
232
|
}
|
|
@@ -16,12 +16,22 @@
|
|
|
16
16
|
#include "ui/tree_internal.h"
|
|
17
17
|
#include "ui/virtual_keyboard.h"
|
|
18
18
|
|
|
19
|
+
#if defined(GEA_EMBEDDED_SHARED_STYLES) && GEA_EMBEDDED_SHARED_STYLES
|
|
20
|
+
#define GEA_DIAGNOSTIC_NODE_STYLE(node) ((node).computedStyle())
|
|
21
|
+
#else
|
|
22
|
+
#define GEA_DIAGNOSTIC_NODE_STYLE(node) ((node).style)
|
|
23
|
+
#endif
|
|
24
|
+
|
|
19
25
|
#include "driver/i2c_master.h"
|
|
20
26
|
#if CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG
|
|
21
27
|
#include "driver/usb_serial_jtag.h"
|
|
22
28
|
#include "driver/usb_serial_jtag_vfs.h"
|
|
23
29
|
#endif
|
|
24
30
|
#include "esp_heap_caps.h"
|
|
31
|
+
#if CONFIG_HEAP_TRACING_STANDALONE
|
|
32
|
+
#include "esp_heap_trace.h"
|
|
33
|
+
#include "esp_memory_utils.h"
|
|
34
|
+
#endif
|
|
25
35
|
#include "platform/file_cache.h" // gea::platform::storage::ensureMounted for GEADEV PUSH
|
|
26
36
|
#include "esp_log.h"
|
|
27
37
|
#include "esp_err.h"
|
|
@@ -50,6 +60,11 @@
|
|
|
50
60
|
#include "host/backends.h" // WifiBackend for GEADEV WIFI
|
|
51
61
|
#include "host/storage.h" // gea::host::Storage for GEADEV STORAGE SET
|
|
52
62
|
|
|
63
|
+
// Older engines expose all four direct position fields.
|
|
64
|
+
#ifndef GEA_CSS_POSITION_PX
|
|
65
|
+
#define GEA_CSS_POSITION_PX(style, side) ((style).pos_offsets[side])
|
|
66
|
+
#endif
|
|
67
|
+
|
|
53
68
|
namespace gea::platform::esp32::services {
|
|
54
69
|
|
|
55
70
|
namespace {
|
|
@@ -756,22 +771,22 @@ void handleNode(char *&cursor)
|
|
|
756
771
|
nodeId,
|
|
757
772
|
node.parent,
|
|
758
773
|
static_cast<int>(node.type),
|
|
759
|
-
node.
|
|
760
|
-
node.
|
|
761
|
-
node.
|
|
762
|
-
node.
|
|
763
|
-
node.
|
|
764
|
-
node.
|
|
765
|
-
node.
|
|
766
|
-
node
|
|
767
|
-
node
|
|
768
|
-
node
|
|
769
|
-
node
|
|
770
|
-
gea::embedded::ui::rstyle(node
|
|
771
|
-
gea::embedded::ui::rstyle(node
|
|
772
|
-
gea::embedded::ui::rstyle(node
|
|
773
|
-
gea::embedded::ui::rstyle(node
|
|
774
|
-
gea::embedded::ui::rstyle(node
|
|
774
|
+
GEA_DIAGNOSTIC_NODE_STYLE(node).display,
|
|
775
|
+
GEA_DIAGNOSTIC_NODE_STYLE(node).width,
|
|
776
|
+
GEA_DIAGNOSTIC_NODE_STYLE(node).height,
|
|
777
|
+
GEA_DIAGNOSTIC_NODE_STYLE(node).min_width,
|
|
778
|
+
GEA_DIAGNOSTIC_NODE_STYLE(node).min_height,
|
|
779
|
+
GEA_DIAGNOSTIC_NODE_STYLE(node).max_width,
|
|
780
|
+
GEA_DIAGNOSTIC_NODE_STYLE(node).max_height,
|
|
781
|
+
GEA_CSS_POSITION_PX(GEA_DIAGNOSTIC_NODE_STYLE(node), 3),
|
|
782
|
+
GEA_CSS_POSITION_PX(GEA_DIAGNOSTIC_NODE_STYLE(node), 0),
|
|
783
|
+
GEA_CSS_POSITION_PX(GEA_DIAGNOSTIC_NODE_STYLE(node), 1),
|
|
784
|
+
GEA_CSS_POSITION_PX(GEA_DIAGNOSTIC_NODE_STYLE(node), 2),
|
|
785
|
+
gea::embedded::ui::rstyle(GEA_DIAGNOSTIC_NODE_STYLE(node)).transform_translate_x,
|
|
786
|
+
gea::embedded::ui::rstyle(GEA_DIAGNOSTIC_NODE_STYLE(node)).transform_translate_y,
|
|
787
|
+
gea::embedded::ui::rstyle(GEA_DIAGNOSTIC_NODE_STYLE(node)).transform_translate_x_percent,
|
|
788
|
+
gea::embedded::ui::rstyle(GEA_DIAGNOSTIC_NODE_STYLE(node)).transform_translate_y_percent,
|
|
789
|
+
gea::embedded::ui::rstyle(GEA_DIAGNOSTIC_NODE_STYLE(node)).transform_rotate,
|
|
775
790
|
node.layout.x,
|
|
776
791
|
node.layout.y,
|
|
777
792
|
node.layout.width,
|
|
@@ -784,9 +799,9 @@ void handleNode(char *&cursor)
|
|
|
784
799
|
ys[2],
|
|
785
800
|
xs[3],
|
|
786
801
|
ys[3],
|
|
787
|
-
static_cast<int>(node.
|
|
788
|
-
static_cast<int>(node.
|
|
789
|
-
static_cast<int>(node.
|
|
802
|
+
static_cast<int>(GEA_DIAGNOSTIC_NODE_STYLE(node).overflow),
|
|
803
|
+
static_cast<int>(GEA_DIAGNOSTIC_NODE_STYLE(node).overflow_x),
|
|
804
|
+
static_cast<int>(GEA_DIAGNOSTIC_NODE_STYLE(node).overflow_y),
|
|
790
805
|
static_cast<int>(node.layout.scroll_x),
|
|
791
806
|
static_cast<int>(node.layout.scroll_y),
|
|
792
807
|
static_cast<int>(node.layout.scroll_content_width),
|
|
@@ -825,15 +840,15 @@ void handleHitTest(char *&cursor)
|
|
|
825
840
|
nodeId,
|
|
826
841
|
node.parent,
|
|
827
842
|
static_cast<int>(node.type),
|
|
828
|
-
node.
|
|
843
|
+
GEA_DIAGNOSTIC_NODE_STYLE(node).display,
|
|
829
844
|
classes.c_str(),
|
|
830
845
|
pressTarget,
|
|
831
846
|
pressId,
|
|
832
|
-
gea::embedded::ui::rstyle(node
|
|
833
|
-
gea::embedded::ui::rstyle(node
|
|
834
|
-
gea::embedded::ui::rstyle(node
|
|
835
|
-
gea::embedded::ui::rstyle(node
|
|
836
|
-
gea::embedded::ui::rstyle(node
|
|
847
|
+
gea::embedded::ui::rstyle(GEA_DIAGNOSTIC_NODE_STYLE(node)).transform_translate_x,
|
|
848
|
+
gea::embedded::ui::rstyle(GEA_DIAGNOSTIC_NODE_STYLE(node)).transform_translate_y,
|
|
849
|
+
gea::embedded::ui::rstyle(GEA_DIAGNOSTIC_NODE_STYLE(node)).transform_translate_x_percent,
|
|
850
|
+
gea::embedded::ui::rstyle(GEA_DIAGNOSTIC_NODE_STYLE(node)).transform_translate_y_percent,
|
|
851
|
+
gea::embedded::ui::rstyle(GEA_DIAGNOSTIC_NODE_STYLE(node)).transform_rotate,
|
|
837
852
|
node.layout.x,
|
|
838
853
|
node.layout.y,
|
|
839
854
|
node.layout.width,
|
|
@@ -1529,6 +1544,46 @@ void handleCommand(char *line, CommandSource source)
|
|
|
1529
1544
|
appId ? appId : "",
|
|
1530
1545
|
intTotal - intFree, intFree, intTotal, intLargest, intMinFree,
|
|
1531
1546
|
psramTotal - psramFree, psramFree, psramTotal, psramLargest);
|
|
1547
|
+
} else if (tokenEquals(command, "HEAPTRACE")) {
|
|
1548
|
+
#if CONFIG_HEAP_TRACING_STANDALONE
|
|
1549
|
+
// Allocate records only on demand, outside internal DMA RAM. Emit
|
|
1550
|
+
// addresses/sizes/stacks, never allocation contents or credentials.
|
|
1551
|
+
static heap_trace_record_t *records = nullptr;
|
|
1552
|
+
constexpr size_t recordCount = 4096;
|
|
1553
|
+
char *action = nextToken(cursor);
|
|
1554
|
+
if (action && tokenEquals(action, "START")) {
|
|
1555
|
+
if (!records) {
|
|
1556
|
+
records = static_cast<heap_trace_record_t *>(heap_caps_calloc(recordCount, sizeof(heap_trace_record_t), MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT));
|
|
1557
|
+
if (!records) { std::printf("GEADEV:ERR HEAPTRACE no-memory\n"); return; }
|
|
1558
|
+
const esp_err_t init = heap_trace_init_standalone(records, recordCount);
|
|
1559
|
+
if (init != ESP_OK) {
|
|
1560
|
+
heap_caps_free(records); records = nullptr;
|
|
1561
|
+
std::printf("GEADEV:ERR HEAPTRACE init=%s\n", esp_err_to_name(init)); return;
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
const esp_err_t start = heap_trace_start(HEAP_TRACE_LEAKS);
|
|
1565
|
+
std::printf("GEADEV:HEAPTRACE START result=%s\n", esp_err_to_name(start));
|
|
1566
|
+
} else if (action && tokenEquals(action, "STOP") && records) {
|
|
1567
|
+
const esp_err_t stop = heap_trace_stop();
|
|
1568
|
+
if (stop != ESP_OK) { std::printf("GEADEV:ERR HEAPTRACE stop=%s\n", esp_err_to_name(stop)); return; }
|
|
1569
|
+
heap_trace_summary_t summary{};
|
|
1570
|
+
heap_trace_summary(&summary);
|
|
1571
|
+
std::printf("GEADEV:HEAPTRACE SUMMARY count=%u capacity=%u high_water=%u overflow=%u\n",
|
|
1572
|
+
unsigned(summary.count), unsigned(summary.capacity), unsigned(summary.high_water_mark), unsigned(summary.has_overflowed));
|
|
1573
|
+
for (size_t i = 0; i < heap_trace_get_count(); ++i) {
|
|
1574
|
+
heap_trace_record_t record{};
|
|
1575
|
+
if (heap_trace_get(i, &record) != ESP_OK || record.freed) continue;
|
|
1576
|
+
std::printf("GEADEV:HEAPTRACE RECORD bytes=%u region=%s address=%p stack=",
|
|
1577
|
+
unsigned(record.size), esp_ptr_internal(record.address) ? "internal" : "external", record.address);
|
|
1578
|
+
for (int j = 0; j < CONFIG_HEAP_TRACING_STACK_DEPTH; ++j) std::printf("%s%p", j ? "," : "", record.alloced_by[j]);
|
|
1579
|
+
std::printf("\n");
|
|
1580
|
+
}
|
|
1581
|
+
if (heap_trace_init_standalone(nullptr, 0) == ESP_OK) { heap_caps_free(records); records = nullptr; }
|
|
1582
|
+
std::printf("GEADEV:HEAPTRACE END\n");
|
|
1583
|
+
} else std::printf("GEADEV:ERR HEAPTRACE usage=START_or_STOP\n");
|
|
1584
|
+
#else
|
|
1585
|
+
std::printf("GEADEV:ERR HEAPTRACE standalone-tracing-not-enabled\n");
|
|
1586
|
+
#endif
|
|
1532
1587
|
} else if (tokenEquals(command, "CANVASSTATS")) {
|
|
1533
1588
|
int tBegin = 0, tEnd = 0, tFillRect = 0, tDrawImage = 0, tNullPx = 0, tPresentOk = 0;
|
|
1534
1589
|
gea::embedded::ui::canvasTotalsRead(&tBegin, &tEnd, &tFillRect, &tDrawImage, &tNullPx, &tPresentOk);
|
|
@@ -1546,8 +1601,8 @@ void handleCommand(char *line, CommandSource source)
|
|
|
1546
1601
|
if (kb >= 0 && kb < tree.nodeCount()) {
|
|
1547
1602
|
const auto &node = tree.node(kb);
|
|
1548
1603
|
std::printf("GEADEV:KBINFO kb=%d active=%d parent=%d display=%d layout=%d,%d %dx%d styleTop=%d styleW=%d styleH=%d\n",
|
|
1549
|
-
kb, active, node.parent, node.
|
|
1550
|
-
node.layout.width, node.layout.height, node
|
|
1604
|
+
kb, active, node.parent, GEA_DIAGNOSTIC_NODE_STYLE(node).display, node.layout.x, node.layout.y,
|
|
1605
|
+
node.layout.width, node.layout.height, GEA_CSS_POSITION_PX(GEA_DIAGNOSTIC_NODE_STYLE(node), 0), GEA_DIAGNOSTIC_NODE_STYLE(node).width, GEA_DIAGNOSTIC_NODE_STYLE(node).height);
|
|
1551
1606
|
} else {
|
|
1552
1607
|
std::printf("GEADEV:KBINFO kb=%d active=%d\n", kb, active);
|
|
1553
1608
|
}
|
|
@@ -21,6 +21,114 @@
|
|
|
21
21
|
#include "freertos/queue.h"
|
|
22
22
|
#include "freertos/task.h"
|
|
23
23
|
|
|
24
|
+
#if defined(GEA_EMBEDDED_FRAME_BENCHMARK) && GEA_EMBEDDED_FRAME_BENCHMARK
|
|
25
|
+
extern "C" void gea_frame_benchmark_sample(int64_t start, int64_t done);
|
|
26
|
+
#if GEA_EMBEDDED_FRAME_BENCHMARK == 2
|
|
27
|
+
// Called at the end of the real target frame, including the display flush.
|
|
28
|
+
// Warm up for 300 frames, collect 3600 frames, then log once outside the sample.
|
|
29
|
+
#include <cstdint>
|
|
30
|
+
#include "esp_attr.h"
|
|
31
|
+
#include "esp_heap_caps.h"
|
|
32
|
+
#include "esp_log.h"
|
|
33
|
+
#include "ui/node_model.h"
|
|
34
|
+
#include "ui/tree_state.h"
|
|
35
|
+
#include "ui/internal.h"
|
|
36
|
+
|
|
37
|
+
namespace {
|
|
38
|
+
constexpr unsigned kWarmup = 300;
|
|
39
|
+
constexpr unsigned kSamples = 3600;
|
|
40
|
+
constexpr unsigned kBins = 1024;
|
|
41
|
+
constexpr unsigned kBinUs = 250;
|
|
42
|
+
struct Distribution {
|
|
43
|
+
std::uint32_t bins[kBins]{};
|
|
44
|
+
std::int64_t sum{};
|
|
45
|
+
std::int64_t maximum{};
|
|
46
|
+
unsigned over_budget{};
|
|
47
|
+
void add(std::int64_t value) {
|
|
48
|
+
sum += value;
|
|
49
|
+
if (value > maximum)
|
|
50
|
+
maximum = value;
|
|
51
|
+
if (value > 16667)
|
|
52
|
+
++over_budget;
|
|
53
|
+
const auto bin = static_cast<unsigned>(value / kBinUs);
|
|
54
|
+
++bins[bin < kBins ? bin : kBins - 1];
|
|
55
|
+
}
|
|
56
|
+
unsigned percentile(unsigned percent) const {
|
|
57
|
+
unsigned count = 0;
|
|
58
|
+
for (unsigned i = 0; i < kBins; ++i) {
|
|
59
|
+
count += bins[i];
|
|
60
|
+
if (count * 100 >= kSamples * percent)
|
|
61
|
+
return (i + 1) * kBinUs;
|
|
62
|
+
}
|
|
63
|
+
return kBins * kBinUs;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
EXT_RAM_BSS_ATTR Distribution work;
|
|
67
|
+
EXT_RAM_BSS_ATTR Distribution cadence;
|
|
68
|
+
unsigned frames{};
|
|
69
|
+
std::int64_t previous_done{};
|
|
70
|
+
} // namespace
|
|
71
|
+
|
|
72
|
+
extern "C" void gea_frame_benchmark_sample(std::int64_t start, std::int64_t done) {
|
|
73
|
+
++frames;
|
|
74
|
+
if (frames > kWarmup && frames <= kWarmup + kSamples) {
|
|
75
|
+
work.add(done - start);
|
|
76
|
+
cadence.add(done - previous_done);
|
|
77
|
+
}
|
|
78
|
+
previous_done = done;
|
|
79
|
+
if (frames != kWarmup + kSamples + 1)
|
|
80
|
+
return;
|
|
81
|
+
unsigned shared = 0, records = 0, payload = 0, heapBytes = 0, staticBytes = 0;
|
|
82
|
+
#if defined(GEA_EMBEDDED_SHARED_STYLES) && GEA_EMBEDDED_SHARED_STYLES
|
|
83
|
+
shared = 1;
|
|
84
|
+
records = unsigned(gea::embedded::ui::NodeStyleStorage::allocatedRecords());
|
|
85
|
+
payload = unsigned(gea::embedded::ui::NodeStyleStorage::allocatedBytes());
|
|
86
|
+
heapBytes = unsigned(gea::embedded::ui::NodeStyleStorage::allocatedHeapBytes());
|
|
87
|
+
staticBytes = unsigned(sizeof(gea::embedded::ui::SharedStyleRecord) + sizeof(void *) + sizeof(std::size_t));
|
|
88
|
+
#endif
|
|
89
|
+
ESP_LOGI("ui_bench", "STORAGE shared=%u nodes=%u capacity=%u tree_bytes=%u node_array_bytes=%u "
|
|
90
|
+
"records=%u record_payload=%u record_heap=%u record_static=%u "
|
|
91
|
+
"memo_active=%u memo_peak_heap=%u memo_static=%u "
|
|
92
|
+
"layout_aux_payload=%u layout_aux_heap=%u layout_aux_allocs=%u "
|
|
93
|
+
"layout_aux_peak=%u layout_aux_peak_allocs=%u layout_aux_static=%u",
|
|
94
|
+
shared, unsigned(gea::embedded::ui::treeState().nodeCount), unsigned(gea::embedded::ui::kMaxNodes),
|
|
95
|
+
unsigned(sizeof(gea::embedded::ui::TreeState)),
|
|
96
|
+
unsigned(sizeof(gea::embedded::ui::Node) * gea::embedded::ui::kMaxNodes),
|
|
97
|
+
records, payload, heapBytes, staticBytes,
|
|
98
|
+
unsigned(gea::embedded::ui::LayoutEngine::memoStorageBytes()),
|
|
99
|
+
unsigned(gea::embedded::ui::LayoutEngine::memoPeakHeapBytes()),
|
|
100
|
+
unsigned(sizeof(void *) + sizeof(std::size_t) + sizeof(int)),
|
|
101
|
+
unsigned(gea::embedded::ui::LayoutEngine::persistentLayoutStorageBytes()),
|
|
102
|
+
unsigned(gea::embedded::ui::LayoutEngine::persistentLayoutHeapBytes()),
|
|
103
|
+
unsigned(gea::embedded::ui::LayoutEngine::persistentLayoutAllocationCount()),
|
|
104
|
+
unsigned(gea::embedded::ui::LayoutEngine::persistentLayoutPeakBytes()),
|
|
105
|
+
unsigned(gea::embedded::ui::LayoutEngine::persistentLayoutPeakAllocations()),
|
|
106
|
+
unsigned(gea::embedded::ui::LayoutEngine::persistentLayoutStaticBytes()));
|
|
107
|
+
const auto owned = gea::embedded::ui::nodeAuxiliaryStorageUsage();
|
|
108
|
+
const auto logOwned = [](const char *group, const gea::embedded::ui::StorageUsage &usage) {
|
|
109
|
+
ESP_LOGI("ui_bench", "OWNED group=%s payload=%u heap=%u allocs=%u static=%u untracked=%u",
|
|
110
|
+
group, unsigned(usage.payload), unsigned(usage.heap), unsigned(usage.allocations),
|
|
111
|
+
unsigned(usage.staticBytes), unsigned(usage.untrackedOwners));
|
|
112
|
+
};
|
|
113
|
+
logOwned("tree", owned.tree); logOwned("text", owned.text);
|
|
114
|
+
logOwned("rare", owned.rare); logOwned("overrides", owned.overrides);
|
|
115
|
+
logOwned("dependencies", owned.dependencies);
|
|
116
|
+
ESP_LOGI("ui_bench",
|
|
117
|
+
"RESULT frames=%u warmup=%u done_total=%lld node=%u style=%u work_avg=%lld work_p99_le=%u work_max=%lld "
|
|
118
|
+
"work_over16667=%u done_avg=%lld done_p99_le=%u done_max=%lld done_over16667=%u "
|
|
119
|
+
"fps_milli=%lld psram_free=%u internal_free=%u",
|
|
120
|
+
kSamples, kWarmup, cadence.sum, unsigned(sizeof(gea::embedded::ui::Node)),
|
|
121
|
+
unsigned(sizeof(gea::embedded::ui::ComputedStyle)), work.sum / kSamples,
|
|
122
|
+
work.percentile(99), work.maximum, work.over_budget, cadence.sum / kSamples,
|
|
123
|
+
cadence.percentile(99), cadence.maximum, cadence.over_budget,
|
|
124
|
+
1000000000LL * kSamples / cadence.sum,
|
|
125
|
+
unsigned(heap_caps_get_free_size(MALLOC_CAP_SPIRAM)),
|
|
126
|
+
unsigned(heap_caps_get_free_size(MALLOC_CAP_INTERNAL)));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
#endif
|
|
130
|
+
#endif
|
|
131
|
+
|
|
24
132
|
namespace gea::framework::services {
|
|
25
133
|
|
|
26
134
|
namespace {
|
|
@@ -59,8 +167,10 @@ constexpr int kTaskCore = GEA_EMBEDDED_APP_FRAME_TASK_CORE;
|
|
|
59
167
|
#define GEA_EMBEDDED_FRAME_SCHEDULER_IDLE_YIELD_TICKS 1
|
|
60
168
|
#endif
|
|
61
169
|
|
|
170
|
+
// Bound sustained catch-up so idle housekeeping still runs when display DMA
|
|
171
|
+
// completes without blocking the frame task. Boards may override this cadence.
|
|
62
172
|
#ifndef GEA_EMBEDDED_FRAME_SCHEDULER_MAX_CATCHUP_FRAMES_BEFORE_YIELD
|
|
63
|
-
#define GEA_EMBEDDED_FRAME_SCHEDULER_MAX_CATCHUP_FRAMES_BEFORE_YIELD
|
|
173
|
+
#define GEA_EMBEDDED_FRAME_SCHEDULER_MAX_CATCHUP_FRAMES_BEFORE_YIELD 32
|
|
64
174
|
#endif
|
|
65
175
|
|
|
66
176
|
#ifndef GEA_EMBEDDED_FRAME_SCHEDULER_USE_ESP_TIMER
|
|
@@ -465,6 +575,9 @@ public:
|
|
|
465
575
|
frameInProgress_.store(false, std::memory_order_release);
|
|
466
576
|
setFrameStage(FrameStage::Idle);
|
|
467
577
|
const int64_t frameDoneUs = esp_timer_get_time();
|
|
578
|
+
#if defined(GEA_EMBEDDED_FRAME_BENCHMARK) && GEA_EMBEDDED_FRAME_BENCHMARK
|
|
579
|
+
gea_frame_benchmark_sample(frameStartUs, frameDoneUs);
|
|
580
|
+
#endif
|
|
468
581
|
// Production-fps probe: deliberately outside GEA_EMBEDDED_PERF, so it still
|
|
469
582
|
// reports the TRUE production frame rate when every other perf subsystem is
|
|
470
583
|
// stripped. It has its own switch because it is otherwise a once-a-second
|
|
@@ -684,7 +797,9 @@ public:
|
|
|
684
797
|
}
|
|
685
798
|
#endif
|
|
686
799
|
if (forceIdleYield) {
|
|
687
|
-
|
|
800
|
+
// One tick can expire immediately at a tick boundary. Two guarantee
|
|
801
|
+
// a full tick for idle housekeeping under sustained catch-up.
|
|
802
|
+
vTaskDelay(2);
|
|
688
803
|
} else if (!catchUpRequested && GEA_EMBEDDED_FRAME_SCHEDULER_IDLE_YIELD_TICKS > 0) {
|
|
689
804
|
vTaskDelay(GEA_EMBEDDED_FRAME_SCHEDULER_IDLE_YIELD_TICKS);
|
|
690
805
|
}
|
|
@@ -430,7 +430,6 @@ target_compile_definitions(${COMPONENT_LIB} PRIVATE
|
|
|
430
430
|
GEA_EMBEDDED_AUDIO_DISABLED=0
|
|
431
431
|
GEA_EMBEDDED_DEFAULT_FRAME_INTERVAL_US=16000
|
|
432
432
|
GEA_EMBEDDED_FRAME_SCHEDULER_USE_ESP_TIMER=1
|
|
433
|
-
GEA_EMBEDDED_FRAME_SCHEDULER_PERF_LITE=1
|
|
434
433
|
GEA_EMBEDDED_FRAME_SCHEDULER_IDLE_YIELD_TICKS=0
|
|
435
434
|
GEA_EMBEDDED_FRAME_SCHEDULER_MAX_CATCHUP_FRAMES_BEFORE_YIELD=60
|
|
436
435
|
GEA_EMBEDDED_DIRTY_REGION_MAX_RECTS=64
|
|
@@ -493,6 +492,7 @@ file(GLOB_RECURSE _GEATSC_DIST_SRCS CONFIGURE_DEPENDS
|
|
|
493
492
|
add_custom_command(
|
|
494
493
|
OUTPUT ${_GEATSC_BUILD_STAMP}
|
|
495
494
|
COMMAND node ${_GEA_VITE_GEATSC_SCRIPT}
|
|
495
|
+
--build-config "${GEA_BUILD_CONFIG_JSON}"
|
|
496
496
|
--app-dir ${GEA_EMBEDDED_APP_DIR}
|
|
497
497
|
--entry ${GEA_EMBEDDED_APP_ENTRY}
|
|
498
498
|
--cpp-board "${GEA_EMBEDDED_CPP_BOARD}"
|
|
@@ -508,6 +508,7 @@ add_custom_command(
|
|
|
508
508
|
${GEA_EMBEDDED_APP_GEATSC_PLUGIN_ARGS}
|
|
509
509
|
COMMAND ${CMAKE_COMMAND} -E touch ${_GEATSC_BUILD_STAMP}
|
|
510
510
|
DEPENDS
|
|
511
|
+
"${GEA_BUILD_CONFIG_JSON}"
|
|
511
512
|
${GEA_EMBEDDED_APP_GEATSC_PLUGINS}
|
|
512
513
|
${_ACTIVE_APP_SRCS}
|
|
513
514
|
${_ACTIVE_APP_ASSETS}
|