@geastack/targets 0.1.78 → 0.1.79
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geastack/targets",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.79",
|
|
4
4
|
"description": "Native embedded build targets (ESP32-IDF, RP2350) for geastack apps: board sources, target catalog, and CMake glue driven by the gea CLI.",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -235,8 +235,36 @@ endif()
|
|
|
235
235
|
set(GEA_EMBEDDED_HTTPS_REQUIRES "")
|
|
236
236
|
set(GEA_EMBEDDED_HTTPS_COMPILE_DEFINITIONS "")
|
|
237
237
|
set(GEA_EMBEDDED_BLE_COMPILE_DEFINITIONS "")
|
|
238
|
-
|
|
238
|
+
|
|
239
|
+
# IDF evaluates this component once in script mode with the broad placeholder
|
|
240
|
+
# app and again for the real configure. A normal variable from the requirements
|
|
241
|
+
# pass can therefore say BLE is enabled even when the selected app does not use
|
|
242
|
+
# it. Only an explicit -D cache value is an override; otherwise resolve the
|
|
243
|
+
# capability again from the real app analysis before choosing sources/REQUIRES.
|
|
244
|
+
# The gea CLI turns the Bluetooth controller off in sdkconfig for apps without
|
|
245
|
+
# the capability, so a build that still compiled ble_hid.cpp would fail on the
|
|
246
|
+
# missing esp_bt.h.
|
|
247
|
+
if(DEFINED ENV{GEA_EMBEDDED_BLE_OTA} AND "$ENV{GEA_EMBEDDED_BLE_OTA}" STREQUAL "1")
|
|
248
|
+
set(GEA_EMBEDDED_CAPABILITY_BLE 1)
|
|
249
|
+
elseif(DEFINED ENV{GEA_EMBEDDED_CAPABILITY_BLE}
|
|
250
|
+
AND NOT "$ENV{GEA_EMBEDDED_CAPABILITY_BLE}" STREQUAL "")
|
|
251
|
+
set(GEA_EMBEDDED_CAPABILITY_BLE "$ENV{GEA_EMBEDDED_CAPABILITY_BLE}")
|
|
252
|
+
elseif(DEFINED CACHE{GEA_EMBEDDED_CAPABILITY_BLE}
|
|
253
|
+
AND NOT "$CACHE{GEA_EMBEDDED_CAPABILITY_BLE}" STREQUAL "")
|
|
254
|
+
set(GEA_EMBEDDED_CAPABILITY_BLE "$CACHE{GEA_EMBEDDED_CAPABILITY_BLE}")
|
|
255
|
+
else()
|
|
256
|
+
set(GEA_EMBEDDED_CAPABILITY_BLE 0)
|
|
257
|
+
if("${_GEA_EMBEDDED_HOST_BINDINGS}" MATCHES "(^|;)ble($|;)")
|
|
258
|
+
set(GEA_EMBEDDED_CAPABILITY_BLE 1)
|
|
259
|
+
endif()
|
|
260
|
+
endif()
|
|
261
|
+
set(GEA_EMBEDDED_BLE_SOURCES "")
|
|
262
|
+
set(GEA_EMBEDDED_BLE_REQUIRES "")
|
|
263
|
+
if(GEA_EMBEDDED_CAPABILITY_BLE)
|
|
239
264
|
list(APPEND GEA_EMBEDDED_BLE_COMPILE_DEFINITIONS GEA_EMBEDDED_APP_USES_BLE=1)
|
|
265
|
+
list(APPEND GEA_EMBEDDED_BLE_SOURCES
|
|
266
|
+
"${GEA_EMBEDDED_ROOT}/targets/esp32/connectivity/ble_hid.cpp")
|
|
267
|
+
list(APPEND GEA_EMBEDDED_BLE_REQUIRES bt)
|
|
240
268
|
endif()
|
|
241
269
|
# Note: BLE driver registration + BLE controller preinit are forced from
|
|
242
270
|
# `app_main.cpp` and `bluetooth_service.cpp` regardless of the macro above,
|
|
@@ -311,8 +339,9 @@ idf_component_register(
|
|
|
311
339
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/frame_scheduler.cpp"
|
|
312
340
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/memory.cpp"
|
|
313
341
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/ota.cpp"
|
|
342
|
+
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/ota_image.cpp"
|
|
314
343
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/storage_service.cpp"
|
|
315
|
-
|
|
344
|
+
${GEA_EMBEDDED_BLE_SOURCES}
|
|
316
345
|
"${GEA_EMBEDDED_ROOT}/targets/esp32/services/heap.cpp"
|
|
317
346
|
${APP_GENERATED_SOURCES}
|
|
318
347
|
INCLUDE_DIRS
|
|
@@ -333,6 +362,10 @@ idf_component_register(
|
|
|
333
362
|
esp_http_client
|
|
334
363
|
${GEA_EMBEDDED_HTTPS_REQUIRES}
|
|
335
364
|
app_update
|
|
365
|
+
esp_app_format
|
|
366
|
+
# esp_flash_read_id: the OTA status endpoint reports the flash JEDEC id,
|
|
367
|
+
# which decides whether CONFIG_SPI_FLASH_AUTO_SUSPEND is safe on a board.
|
|
368
|
+
spi_flash
|
|
336
369
|
esp_mm
|
|
337
370
|
esp_netif
|
|
338
371
|
esp_event
|
|
@@ -343,7 +376,7 @@ idf_component_register(
|
|
|
343
376
|
esp_driver_ledc
|
|
344
377
|
esp_driver_usb_serial_jtag
|
|
345
378
|
esp_psram
|
|
346
|
-
|
|
379
|
+
${GEA_EMBEDDED_BLE_REQUIRES}
|
|
347
380
|
LDFRAGMENTS
|
|
348
381
|
)
|
|
349
382
|
|
|
@@ -420,6 +453,11 @@ target_compile_definitions(${COMPONENT_LIB} PRIVATE
|
|
|
420
453
|
# then-broken queueFrameEvent catch-up. =0 re-enables catch-up, now driven by
|
|
421
454
|
# the work-based, event-loop graceful-overrun path (frame_scheduler/runtime).
|
|
422
455
|
GEA_EMBEDDED_FRAME_SCHEDULER_DROP_CATCHUP_FRAMES=0
|
|
456
|
+
# A heavy canvas app overruns every frame on this panel (bouncing-balls-jsx
|
|
457
|
+
# sits at ~48ms against an 8ms target), so the graceful-overrun catch-up loop
|
|
458
|
+
# never yields and IDLE0 starves: the task watchdog fires every 5s. Cap the
|
|
459
|
+
# burst like the P4 boards do so idle runs at least every 60 frames.
|
|
460
|
+
GEA_EMBEDDED_FRAME_SCHEDULER_MAX_CATCHUP_FRAMES_BEFORE_YIELD=60
|
|
423
461
|
GEA_EMBEDDED_APP_FRAME_TASK_PRIORITY=23
|
|
424
462
|
${GEA_EMBEDDED_BLE_COMPILE_DEFINITIONS}
|
|
425
463
|
${GEA_EMBEDDED_HTTPS_COMPILE_DEFINITIONS}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
#include "gea_embedded_app_config.h"
|
|
2
2
|
|
|
3
|
+
#include "sdkconfig.h"
|
|
4
|
+
|
|
3
5
|
#include "apps/app_manager.h"
|
|
6
|
+
#if CONFIG_BT_ENABLED && defined(GEA_EMBEDDED_APP_USES_BLE)
|
|
4
7
|
#include "connectivity/ble_hid.h"
|
|
8
|
+
#endif
|
|
5
9
|
#include "display.h"
|
|
6
10
|
|
|
7
11
|
// Forward-declare here instead of through a header — there's already a
|
|
@@ -173,9 +177,11 @@ extern "C" void app_main(void)
|
|
|
173
177
|
// We can't just define the macro unconditionally either — it also gates
|
|
174
178
|
// `gea_init`'s SPIRAM-vs-DRAM placement in `app_runner.cpp`, and forcing
|
|
175
179
|
// DRAM there fails (64 KB stack > 32 KB largest contiguous block at
|
|
176
|
-
// init time).
|
|
177
|
-
// macro narrow.
|
|
180
|
+
// init time). The board build's independently resolved BLE capability controls
|
|
181
|
+
// whether this driver is linked and registered; the analyzer macro stays narrow.
|
|
182
|
+
#if CONFIG_BT_ENABLED && defined(GEA_EMBEDDED_APP_USES_BLE)
|
|
178
183
|
gea::targets::esp32::ble::registerHidDriver();
|
|
184
|
+
#endif
|
|
179
185
|
|
|
180
186
|
BaseType_t created = createRuntimeTask();
|
|
181
187
|
if (created != pdPASS) {
|
|
@@ -492,6 +492,22 @@ void replayPresentCommand(const gea::platform::display::DisplayPresentCommand &c
|
|
|
492
492
|
command.fillTriangleRgb565.y2,
|
|
493
493
|
command.fillTriangleRgb565.color);
|
|
494
494
|
break;
|
|
495
|
+
case Type::FillTrianglesRgb565: {
|
|
496
|
+
// Depth-ordered batch (farthest-first). Opaque batches take the span-occlusion
|
|
497
|
+
// path so each pixel is written once; translucent ones must stay painter's order.
|
|
498
|
+
const auto &batch = command.fillTrianglesRgb565;
|
|
499
|
+
if (!batch.entries) break;
|
|
500
|
+
g_canvas.setGlobalAlpha(batch.alpha);
|
|
501
|
+
if (batch.alpha == 255) {
|
|
502
|
+
g_canvas.fillTrianglesOpaqueOccluded(batch.entries, batch.count, 0, 0);
|
|
503
|
+
} else {
|
|
504
|
+
for (int i = 0; i < batch.count; i++) {
|
|
505
|
+
const auto &t = batch.entries[i];
|
|
506
|
+
g_canvas.fillTriangle(t.x0, t.y0, t.x1, t.y1, t.x2, t.y2, t.color);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
break;
|
|
510
|
+
}
|
|
495
511
|
case Type::FillCircleRgb565:
|
|
496
512
|
g_canvas.setGlobalAlpha(command.fillCircleRgb565.alpha);
|
|
497
513
|
g_canvas.fillCircle(command.fillCircleRgb565.x,
|
|
@@ -1080,6 +1096,15 @@ bool Display::start()
|
|
|
1080
1096
|
// dirty accumulator over the same framebuffer. On the main core this is g_canvas.
|
|
1081
1097
|
gea::framework::graphics::Canvas *Display::canvas() { return &replayCanvas(); }
|
|
1082
1098
|
|
|
1099
|
+
// The render layer binds canvas() onto a scratch buffer (retained snapshots for
|
|
1100
|
+
// screenshots/OTA, fused rasterized flushes) and calls this to point it back at
|
|
1101
|
+
// the draw framebuffer. bindPixels resets the dirty tracker, which is right
|
|
1102
|
+
// here: the union it held describes the scratch buffer, not the framebuffer.
|
|
1103
|
+
void Display::rebindCanvasToFramebuffer()
|
|
1104
|
+
{
|
|
1105
|
+
replayCanvas().bindPixels(g_drawFramebuffer, kWidth, kHeight);
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1083
1108
|
bool Display::copySnapshotRgb565(std::uint16_t *dst, int pixelCapacity, int *width, int *height, bool)
|
|
1084
1109
|
{
|
|
1085
1110
|
if (width) *width = kWidth;
|