@geastack/targets 0.1.113 → 0.1.114

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/build-config.json CHANGED
@@ -788,6 +788,17 @@
788
788
  }
789
789
  },
790
790
  "cssDevicePixelRatio": 1.5
791
+ },
792
+ "esp32-p4-elecrow-crowpanel-advanced-5.0": {
793
+ "supported": [
794
+ "compiler.generatedCodeOptimization"
795
+ ],
796
+ "defaults": {
797
+ "compiler": {
798
+ "generatedCodeOptimization": "O2",
799
+ "numberPrecision": "float32"
800
+ }
801
+ }
791
802
  }
792
803
  }
793
804
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/targets",
3
- "version": "0.1.113",
3
+ "version": "0.1.114",
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": {
@@ -39,7 +39,7 @@
39
39
  "@geastack/chips": "^0.1.8",
40
40
  "@geastack/compiler": "^1.0.41",
41
41
  "@geastack/core": "0.1.53",
42
- "@geastack/elements": "^0.1.6",
42
+ "@geastack/elements": "^0.1.7",
43
43
  "@geastack/engine": "^0.1.24",
44
44
  "@geastack/geaos": "^0.1.3",
45
45
  "@geastack/geatsc-plugin-gea": "0.1.28",
@@ -3658,9 +3658,16 @@ void Display::setBrightness(int brightnessPercent)
3658
3658
  // panel to release the back buffer and no patching it from the front -- on 64
3659
3659
  // bouncing balls those cost ~9 ms and a PSRAM copy of every changed pixel a
3660
3660
  // frame. The app accepts that a moving object may show split across a scan.
3661
+ // GEA_EMBEDDED_RGB_KEEP_VSYNC=1 (a per-board app define) keeps the swapped
3662
+ // buffers when the app asks for VSync off: an app that redraws the whole
3663
+ // screen every frame flickers in direct draw, since the panel scans the
3664
+ // background before the layers drawn over it.
3665
+ #ifndef GEA_EMBEDDED_RGB_KEEP_VSYNC
3666
+ #define GEA_EMBEDDED_RGB_KEEP_VSYNC 0
3667
+ #endif
3661
3668
  void Display::setVSync(bool on)
3662
3669
  {
3663
- g_vsyncWanted = on;
3670
+ g_vsyncWanted = on || GEA_EMBEDDED_RGB_KEEP_VSYNC;
3664
3671
  applyVSync();
3665
3672
  }
3666
3673
  void Display::invalidate() {}
@@ -11,6 +11,7 @@
11
11
  #include <string>
12
12
 
13
13
  #if defined(GEA_STORAGE_SPIFFS)
14
+ #include "esp_partition.h"
14
15
  #include "esp_spiffs.h"
15
16
  #endif
16
17
 
@@ -53,6 +54,10 @@ bool StorageService::init() {
53
54
  return false;
54
55
  }
55
56
  #if defined(GEA_STORAGE_SPIFFS)
57
+ // A base shared by several boards compiles this in for all of them; only a
58
+ // partition table that carries `storage` gets the mount.
59
+ if (!esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_SPIFFS, kSpiffsPartition))
60
+ return true;
56
61
  esp_vfs_spiffs_conf_t conf = {};
57
62
  conf.base_path = kSpiffsBase;
58
63
  conf.partition_label = kSpiffsPartition;
@@ -133,8 +133,11 @@ file(GLOB _GEA_FONT_ASSETS
133
133
  # GEA_EMBEDDED_APP_DIR/ENTRY/RUNTIME/NATIVE_SOURCE_RELS variables come from there.
134
134
 
135
135
  set(GEA_EMBEDDED_APP_NATIVE_SOURCES "")
136
+ set(GEA_EMBEDDED_APP_NATIVE_INCLUDE_DIRS "")
136
137
  foreach(_GEA_EMBEDDED_APP_NATIVE_SOURCE_REL IN LISTS GEA_EMBEDDED_APP_NATIVE_SOURCE_RELS)
137
138
  list(APPEND GEA_EMBEDDED_APP_NATIVE_SOURCES "${GEA_EMBEDDED_APP_DIR}/${_GEA_EMBEDDED_APP_NATIVE_SOURCE_REL}")
139
+ get_filename_component(_GEA_APP_NATIVE_DIR "${GEA_EMBEDDED_APP_DIR}/${_GEA_EMBEDDED_APP_NATIVE_SOURCE_REL}" DIRECTORY)
140
+ list(APPEND GEA_EMBEDDED_APP_NATIVE_INCLUDE_DIRS "${_GEA_APP_NATIVE_DIR}")
138
141
  endforeach()
139
142
 
140
143
  set(JS_APP_SRC "${GEA_EMBEDDED_APP_DIR}/${GEA_EMBEDDED_APP_ENTRY}")
@@ -258,10 +261,13 @@ set(APP_GENERATED_SOURCES
258
261
  ${GENERATED_FONT_CPP}
259
262
  ${GENERATED_ASSETS_CPP}
260
263
  )
264
+ if(NOT GEA_BUILD_COMPILER_GENERATED_CODE_OPTIMIZATION)
265
+ set(GEA_BUILD_COMPILER_GENERATED_CODE_OPTIMIZATION "Os")
266
+ endif()
261
267
  set(GEATSC_COMPILE_OPTIONS
262
268
  -Wno-unused-variable
263
269
  -Wno-return-type
264
- -Os
270
+ -${GEA_BUILD_COMPILER_GENERATED_CODE_OPTIMIZATION}
265
271
  )
266
272
  set(GEATSC_COMPILE_DEFINITIONS "")
267
273
  if(NOT CMAKE_SCRIPT_MODE_FILE)
@@ -397,6 +403,7 @@ idf_component_register(
397
403
  "include"
398
404
  "${GEA_EMBEDDED_ROOT}/targets/esp32"
399
405
  ${GEA_FW_INCLUDE_DIRS}
406
+ ${GEA_EMBEDDED_APP_NATIVE_INCLUDE_DIRS}
400
407
  "${GEA_CHIPS}"
401
408
  ${GENERATED_APP_DIR}
402
409
  ${CMAKE_BINARY_DIR}
@@ -431,6 +438,9 @@ idf_component_register(
431
438
  esp_driver_sdmmc
432
439
  sdmmc
433
440
  fatfs
441
+ # services/storage_service.cpp mounts a `storage` SPIFFS partition at
442
+ # /storage when the partition table has one.
443
+ spiffs
434
444
  esp_codec_dev
435
445
  esp_video
436
446
  ${GEA_P4_BOARD_REQUIRES}
@@ -458,6 +468,14 @@ if(TARGET idf::fatfs)
458
468
  "SHELL:-include ${CMAKE_CURRENT_LIST_DIR}/fatfs_ffconf.h")
459
469
  endif()
460
470
 
471
+ # P4 silicon before rev 3 links with --enable-non-contiguous-regions (its SRAM
472
+ # is split). With that on, ld's RISC-V relaxation does not terminate in useful
473
+ # time on a large image: an 8 MB .flash.text was still relaxing after 27 minutes
474
+ # and links in 22 s without it.
475
+ if(CONFIG_ESP32P4_SELECTS_REV_LESS_V3)
476
+ target_link_options(${COMPONENT_LIB} INTERFACE "-Wl,--no-relax")
477
+ endif()
478
+
461
479
  set(GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE 0)
462
480
  if(DEFINED ENV{GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG})
463
481
  set(GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE "$ENV{GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG}")
@@ -465,6 +483,7 @@ endif()
465
483
 
466
484
  target_compile_definitions(${COMPONENT_LIB} PRIVATE
467
485
  ${GEA_P4_BOARD_DEFINITIONS}
486
+ GEA_STORAGE_SPIFFS=1
468
487
  GEA_EMBEDDED_BOARD_ID="${GEA_EMBEDDED_CPP_BOARD}"
469
488
  GEA_CPP_ENABLE_REGEX=0
470
489
  GEA_CPP_USE_TO_CHARS_DOUBLE=0
@@ -19,6 +19,7 @@
19
19
  #include "diskio_sdmmc.h"
20
20
  #include "driver/sdmmc_host.h"
21
21
  #include "esp_log.h"
22
+ #include "esp_spiffs.h"
22
23
  #include "esp_vfs_fat.h"
23
24
  #include "ff.h"
24
25
  #include "board.h"
@@ -139,6 +140,16 @@ bool mountSdCard()
139
140
  return g_mounted;
140
141
  }
141
142
 
143
+ // The file store an app reads and writes by absolute path. The card when one
144
+ // is in the slot; with none, a build whose partition table carries a `storage`
145
+ // SPIFFS partition (mounted at /storage by the storage service) still has
146
+ // that. A build without the partition keeps the card as its only store.
147
+ bool mountFileStore()
148
+ {
149
+ if (mountSdCard()) return true;
150
+ return esp_spiffs_mounted("storage");
151
+ }
152
+
142
153
  } // namespace
143
154
 
144
155
  // Wire the microSD card as the persistent file-cache backend. Called once from
@@ -146,7 +157,7 @@ bool mountSdCard()
146
157
  // is linked, so the SD provider actually replaces the default (no-storage) one.
147
158
  void installSdCardFileCache()
148
159
  {
149
- setMountProvider(&mountSdCard);
160
+ setMountProvider(&mountFileStore);
150
161
  }
151
162
 
152
163
  } // namespace gea::platform::storage