@geastack/targets 0.1.93 → 0.1.95

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.93",
3
+ "version": "0.1.95",
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": {
@@ -37,12 +37,12 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@geastack/chips": "^0.1.5",
40
- "@geastack/compiler": "^1.0.22",
41
- "@geastack/core": "^0.1.37",
40
+ "@geastack/compiler": "^1.0.25",
41
+ "@geastack/core": "^0.1.39",
42
42
  "@geastack/elements": "^0.1.5",
43
- "@geastack/engine": "^0.1.13",
43
+ "@geastack/engine": "^0.1.15",
44
44
  "@geastack/geaos": "^0.1.3",
45
- "@geastack/geatsc-plugin-gea": "^0.1.19",
45
+ "@geastack/geatsc-plugin-gea": "^0.1.21",
46
46
  "@geastack/host": "^0.1.14"
47
47
  },
48
48
  "scripts": {
@@ -1080,6 +1080,12 @@ void Display::rebindCanvasToFramebuffer()
1080
1080
  replayCanvas().bindPixels(g_drawFramebuffer, kWidth, kHeight);
1081
1081
  }
1082
1082
 
1083
+ // The RGB panel scans out of g_framebuffer continuously, so it holds exactly
1084
+ // what the panel shows: a screenshot copies it rather than re-rendering the
1085
+ // display list on the device-control task (which also overflowed that task's
1086
+ // stack rasterizing triangles).
1087
+ extern "C" bool geaDisplaySnapshotPrefersPresented() { return true; }
1088
+
1083
1089
  bool Display::copySnapshotRgb565(std::uint16_t *dst, int pixelCapacity, int *width, int *height, bool)
1084
1090
  {
1085
1091
  if (width) *width = kWidth;
@@ -1087,7 +1093,8 @@ bool Display::copySnapshotRgb565(std::uint16_t *dst, int pixelCapacity, int *wid
1087
1093
  if (!dst || pixelCapacity < static_cast<int>(kPixelCount)) return false;
1088
1094
  const std::uint16_t *source = g_framebuffer ? g_framebuffer : g_drawFramebuffer;
1089
1095
  if (!source) return false;
1090
- std::copy_n(source, kPixelCount, dst);
1096
+ // Native pixels are panel byte order; a snapshot is plain RGB565.
1097
+ for (std::size_t i = 0; i < kPixelCount; ++i) dst[i] = gea::framework::graphics::pixel::toRgb565(source[i]);
1091
1098
  return true;
1092
1099
  }
1093
1100
 
@@ -71,6 +71,10 @@ extern "C" uint32_t gea_display_completed_chunks() __attribute__((weak));
71
71
  #include <algorithm>
72
72
  #endif
73
73
  #include "audio.h" // gea::platform::audio::AudioSystem for GEADEV PLAYFILE
74
+ #if GEA_AUDIO_EXPERIMENT
75
+ #include "../chip_bindings/audio/echo_cancellation.h"
76
+ #include <cmath>
77
+ #endif
74
78
  #include "power.h" // Power::batteryPercent() for STATE battery
75
79
  #include "host/notify.h" // gea::host::postNotification() for GEADEV NOTIFY
76
80
  #include "host/backends.h" // WifiBackend for GEADEV WIFI
@@ -104,9 +108,13 @@ namespace {
104
108
  #endif
105
109
 
106
110
  constexpr const char *kTag = "gea_device_ctl";
107
- constexpr int kTaskStackBytes = 8192;
111
+ // 16 KB: a screenshot of a retained or fused-flush frame re-rasterizes the
112
+ // display list on this task (renderRetainedSnapshotRgb565), and the triangle
113
+ // rasterizer overflowed 8 KB there (stack protection fault in
114
+ // Canvas::fillTriangleOpaque on the mosaico).
115
+ constexpr int kTaskStackBytes = 16384;
108
116
  constexpr int kTaskPriority = 4;
109
- constexpr int kUsbJtagTaskStackBytes = 8192;
117
+ constexpr int kUsbJtagTaskStackBytes = 16384;
110
118
 
111
119
  enum class CommandSource {
112
120
  Stdio,
@@ -265,7 +273,14 @@ bool captureSnapshotRgb565(std::uint16_t *snapshot, int pixelCapacity, int *widt
265
273
  // holds the real, just-presented frame, so copy that instead. Only the fused path
266
274
  // leaves the framebuffer frozen at frame 0 -- that is the case the re-replay was
267
275
  // written for, and it keeps it.
276
+ #if GEA_EMBEDDED_DISPLAY_BANDED_UI
277
+ // Banded UI mode streams retained frames band by band from internal RAM; the
278
+ // framebuffer only holds the frame when the last one fell back to it.
279
+ const bool framebufferIsLive = GEA_EMBEDDED_DISPLAY_FUSE_REPLAY_FLUSH == 0 &&
280
+ !gea::embedded::ui::retainedFramebufferStale();
281
+ #else
268
282
  const bool framebufferIsLive = GEA_EMBEDDED_DISPLAY_FUSE_REPLAY_FLUSH == 0;
283
+ #endif
269
284
  if (framebufferIsLive ||
270
285
  (geaDisplaySnapshotPrefersPresented && geaDisplaySnapshotPrefersPresented())) {
271
286
  copied = Display::copySnapshotRgb565(snapshot, pixelCapacity, width, height, true);
@@ -2017,6 +2032,24 @@ void handleCommand(char *line, CommandSource source)
2017
2032
  handleRemoveFile(cursor);
2018
2033
  } else if (tokenEquals(command, "PULL")) {
2019
2034
  handlePull(cursor);
2035
+ #if GEA_AUDIO_EXPERIMENT
2036
+ } else if (tokenEquals(command, "AUDIO")) {
2037
+ char *key = nextToken(cursor);
2038
+ char *value = nextToken(cursor);
2039
+ bool ok = true;
2040
+ if (key) {
2041
+ char *end = nullptr;
2042
+ const float number = value ? std::strtof(value, &end) : NAN;
2043
+ ok = value && end && *end == '\0' && std::isfinite(number);
2044
+ if (ok && !std::strcmp(key, "speaker")) {
2045
+ ok = number >= 0 && number <= 100 && std::floor(number) == number;
2046
+ if (ok) gea::platform::audio::AudioSystem::setVolume(int(number));
2047
+ } else if (ok) ok = geaAudioExperimentConfigure(key, number);
2048
+ }
2049
+ char state[512];
2050
+ geaAudioExperimentDescribe(state, sizeof(state));
2051
+ std::printf("GEADEV:AUDIO %s %s\n", ok ? "OK" : "ERR", state);
2052
+ #endif
2020
2053
  } else if (tokenEquals(command, "PLAYFILE")) {
2021
2054
  handlePlayFile(cursor);
2022
2055
  } else if (tokenEquals(command, "VP8BENCH")) {
@@ -34,6 +34,10 @@ set(GEA_BOARD_EXTRA_COMPILE_DEFINITIONS
34
34
  GEA_BOARD_USB_CONSOLE=1
35
35
  # `gea flash` installs apps through the running app (usbAppUpdate).
36
36
  GEA_DEVICE_CONTROL_USB_OTA=1
37
+ # Framebuffer-free retained UI: each dirty band is rendered straight into the
38
+ # internal-RAM DMA staging chunk and streamed while the next band renders,
39
+ # instead of writing the PSRAM framebuffer and reading it back to flush.
40
+ GEA_EMBEDDED_DISPLAY_BANDED_UI=1
37
41
  GEA_EMBEDDED_CO5300_MOSAICO_INIT=1
38
42
  GEA_EMBEDDED_CO5300_PANEL_X_GAP=0
39
43
  GEA_EMBEDDED_CO5300_PANEL_Y_GAP=0