@geastack/targets 0.1.111 → 0.1.112

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.
@@ -1,564 +0,0 @@
1
- set(GEA_EMBEDDED_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../..")
2
- cmake_path(ABSOLUTE_PATH GEA_EMBEDDED_ROOT NORMALIZE)
3
-
4
- # geastack split: resolve the gea framework via npm + the shared manifest.
5
- # Exports GEA_CORE/GEA_COMPILER/GEA_PLUGIN/GEA_CHIPS/GEA_HOST,
6
- # GEA_APP_ENTRY_SRC, and GEA_FW_CXX_SOURCES/GEA_FW_C_SOURCES/GEA_FW_INCLUDE_DIRS.
7
- include("${GEA_EMBEDDED_ROOT}/targets/esp32/gea_framework.cmake")
8
- include("${GEA_EMBEDDED_ROOT}/targets/cmake/geatsc_generated_archive.cmake")
9
-
10
- # The esp32-p4 base: every board built through this project is a composed one.
11
- # Its JSON definition (targets/<id>.json, `extends: esp32-p4`) names the chips
12
- # and pins; the gea CLI generates board.h and target.cmake from it into the
13
- # build directory before configure. The CLI passes the definition both as
14
- # -DGEA_BOARD_DEFINITION and in the environment: IDF's requirement-extraction
15
- # pass (cmake -P) runs before the -D arguments reach the cache, and a composed
16
- # chip's own REQUIRES have to be visible in that pass.
17
- set(GEA_CUSTOM_TARGET_ACTIVE 0)
18
- if(NOT GEA_BOARD_DEFINITION AND DEFINED ENV{GEA_BOARD_DEFINITION})
19
- set(GEA_BOARD_DEFINITION "$ENV{GEA_BOARD_DEFINITION}")
20
- endif()
21
- if(NOT GEA_CUSTOM_TARGET_DIR AND DEFINED ENV{GEA_CUSTOM_TARGET_DIR})
22
- set(GEA_CUSTOM_TARGET_DIR "$ENV{GEA_CUSTOM_TARGET_DIR}")
23
- endif()
24
- if(NOT GEA_CUSTOM_TARGET_DIR)
25
- set(GEA_CUSTOM_TARGET_DIR "${CMAKE_BINARY_DIR}/gea-custom-target")
26
- endif()
27
- if(NOT GEA_BOARD_DEFINITION OR NOT EXISTS "${GEA_CUSTOM_TARGET_DIR}/target.cmake")
28
- message(FATAL_ERROR "The esp32-p4 base builds composed boards only, and their board files were not generated at ${GEA_CUSTOM_TARGET_DIR}. Build through the gea CLI with a board whose target definition extends esp32-p4 (gea build --board <alias>).")
29
- endif()
30
- include("${GEA_CUSTOM_TARGET_DIR}/target.cmake")
31
- message(STATUS "Custom board: ${GEA_BOARD_DEFINITION}")
32
-
33
- # GEA_EMBEDDED_APP must be set explicitly in the real configure pass — no
34
- # default. The build script `scripts/board` passes
35
- # `-DGEA_EMBEDDED_APP=<id>` for every command, so this is invisible in
36
- # normal use. Without an explicit value the previous default `tic-tac-toe`
37
- # silently picked an arbitrary app whose features didn't match the user's
38
- # actual selection, producing a REQUIRES list mismatched against the real
39
- # pass.
40
- #
41
- # Script-mode (`cmake -P`, used by IDF's component_get_requirements.cmake)
42
- # is a special case: it runs before the user's -D args reach the cache, so
43
- # a hard error there would break component-requirement extraction
44
- # entirely. We fall through to `tilt-breakout` in that pass because it is a
45
- # gea app with a broad native binding surface.
46
- set(GEA_EMBEDDED_APP "" CACHE STRING "Example app to build (must match a package.json gea.id) — required, no default")
47
- if(CMAKE_SCRIPT_MODE_FILE AND "${GEA_EMBEDDED_APP}" STREQUAL "")
48
- set(GEA_EMBEDDED_APP "tilt-breakout")
49
- elseif(NOT CMAKE_SCRIPT_MODE_FILE AND "${GEA_EMBEDDED_APP}" STREQUAL "")
50
- message(FATAL_ERROR "GEA_EMBEDDED_APP is required. Pass -DGEA_EMBEDDED_APP=<id> or use scripts/board which sets it for you (see package.json gea.id values for valid ids).")
51
- endif()
52
-
53
- set(GEA_EMBEDDED_HTTPS_SUPPORT "auto" CACHE STRING "Enable HTTPS fetch support: auto, on, or off")
54
- # geatsc gets the composed board's own name, pixel order and font viewport.
55
- set(GEA_EMBEDDED_CPP_BOARD "${GEA_CUSTOM_TARGET_BOARD_ID}")
56
- set(GEA_EMBEDDED_FONT_VIEWPORT_ARGS "")
57
- if(GEA_CUSTOM_TARGET_VIEWPORT_WIDTH AND GEA_CUSTOM_TARGET_VIEWPORT_HEIGHT)
58
- set(GEA_EMBEDDED_FONT_VIEWPORT_ARGS
59
- --font-viewport-width ${GEA_CUSTOM_TARGET_VIEWPORT_WIDTH}
60
- --font-viewport-height ${GEA_CUSTOM_TARGET_VIEWPORT_HEIGHT})
61
- endif()
62
- set(GEA_EMBEDDED_CSS_DEVICE_PIXEL_RATIO "1.0" CACHE STRING "Logical CSS px to physical pixel scale for this board")
63
-
64
- # Write a file only when its content would change. Preserves mtime when content matches,
65
- # so downstream make/ninja rules don't see spurious changes on every reconfigure.
66
- function(_gea_write_if_different FILE_PATH CONTENT)
67
- set(_should_write 1)
68
- if(EXISTS "${FILE_PATH}")
69
- file(READ "${FILE_PATH}" _existing)
70
- if("${_existing}" STREQUAL "${CONTENT}")
71
- set(_should_write 0)
72
- endif()
73
- endif()
74
- if(_should_write)
75
- file(WRITE "${FILE_PATH}" "${CONTENT}")
76
- endif()
77
- endfunction()
78
-
79
- include("${GEA_EMBEDDED_ROOT}/targets/esp32/gea_find_sources.cmake")
80
-
81
- # Source files that affect Gea compiler -> geatsc output. Keep this scoped to
82
- # the embedded framework, upstream Gea compiler, and @geatsc/plugin-gea.
83
- _gea_find_sources(_GEA_COMPILER_DEP_SRCS "${GEA_CORE}/..")
84
- _gea_find_sources(_GEA_UPSTREAM_GEA_SRCS "${GEA_COMPILER}" PRUNE_VENDOR)
85
- _gea_find_sources(_GEATSC_GEA_PLUGIN_SRCS "${GEA_PLUGIN}")
86
- if(CMAKE_SCRIPT_MODE_FILE)
87
- file(GLOB_RECURSE _GEATSC_GEA_PLUGIN_DIST_SRCS
88
- "${GEA_PLUGIN}/dist/*.js"
89
- "${GEA_PLUGIN}/dist/*.json"
90
- )
91
- else()
92
- file(GLOB_RECURSE _GEATSC_GEA_PLUGIN_DIST_SRCS CONFIGURE_DEPENDS
93
- "${GEA_PLUGIN}/dist/*.js"
94
- "${GEA_PLUGIN}/dist/*.json"
95
- )
96
- endif()
97
- list(APPEND _GEA_COMPILER_DEP_SRCS
98
- "${GEA_CORE}/scripts/build-gea-vite-geatsc.mjs"
99
- "${GEA_CORE}/scripts/gea-embedded-compat-transform.mjs"
100
- "${GEA_CORE}/scripts/generate-gea-embedded-fonts.mjs"
101
- ${_GEA_UPSTREAM_GEA_SRCS}
102
- ${_GEATSC_GEA_PLUGIN_SRCS}
103
- ${_GEATSC_GEA_PLUGIN_DIST_SRCS}
104
- )
105
- list(REMOVE_DUPLICATES _GEA_COMPILER_DEP_SRCS)
106
- get_property(_GEA_CONFIGURE_DEPS_REGISTERED GLOBAL PROPERTY GEA_CONFIGURE_DEPS_REGISTERED)
107
- if(NOT CMAKE_SCRIPT_MODE_FILE AND _GEA_COMPILER_DEP_SRCS AND NOT _GEA_CONFIGURE_DEPS_REGISTERED)
108
- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${_GEA_COMPILER_DEP_SRCS})
109
- set_property(GLOBAL PROPERTY GEA_CONFIGURE_DEPS_REGISTERED TRUE)
110
- endif()
111
-
112
- # host/camera.cpp (and the rest of the generic host layer) now comes from the
113
- # shared manifest gea_sources.sh — it compiles on every board and is a runtime
114
- # no-op where there's no camera, so no board-specific gating is needed here.
115
-
116
- file(GLOB _GEA_FONT_ASSETS
117
- "${GEA_EMBEDDED_ROOT}/assets/fonts/*.ttf"
118
- "${GEA_EMBEDDED_ROOT}/assets/fonts/*.otf"
119
- "${GEA_EMBEDDED_ROOT}/assets/fonts/*.woff"
120
- "${GEA_EMBEDDED_ROOT}/assets/fonts/*.woff2"
121
- )
122
-
123
- # App metadata (root;entry;runtime;native sources...) is resolved once by the
124
- # gea CLI and handed to gea_framework.cmake as GEA_EMBEDDED_APP_META; the
125
- # GEA_EMBEDDED_APP_DIR/ENTRY/RUNTIME/NATIVE_SOURCE_RELS variables come from there.
126
-
127
- set(GEA_EMBEDDED_APP_NATIVE_SOURCES "")
128
- foreach(_GEA_EMBEDDED_APP_NATIVE_SOURCE_REL IN LISTS GEA_EMBEDDED_APP_NATIVE_SOURCE_RELS)
129
- list(APPEND GEA_EMBEDDED_APP_NATIVE_SOURCES "${GEA_EMBEDDED_APP_DIR}/${_GEA_EMBEDDED_APP_NATIVE_SOURCE_REL}")
130
- endforeach()
131
-
132
- set(JS_APP_SRC "${GEA_EMBEDDED_APP_DIR}/${GEA_EMBEDDED_APP_ENTRY}")
133
-
134
- # Each application's generated output gets its own build directory.
135
- set(GENERATED_APP_DIR "${CMAKE_BINARY_DIR}/apps/${GEA_EMBEDDED_APP}")
136
- file(MAKE_DIRECTORY "${GENERATED_APP_DIR}")
137
- set(JS_APP "${GENERATED_APP_DIR}/dist/index.js")
138
- # geatsc emits one C++ translation unit per source module and records the
139
- # compile set in geatsc-sources.txt. A generated archive consumes that list at
140
- # build time so CMake configure does not need to know module filenames up front.
141
- set(GEATSC_SOURCE_LIST "${GENERATED_APP_DIR}/geatsc-sources.txt")
142
- set(GEATSC_ARCHIVE "${GENERATED_APP_DIR}/libgea_active_geatsc.a")
143
- set(GENERATED_FONT_CPP "${GENERATED_APP_DIR}/gea_embedded_font_generated.cpp")
144
- set(GENERATED_FONT_H "${GENERATED_APP_DIR}/gea_embedded_font_generated.h")
145
- set(GENERATED_ASSETS_CPP "${GENERATED_APP_DIR}/gea_embedded_assets_generated.cpp")
146
- set(GENERATED_CONFIG_H "${GENERATED_APP_DIR}/gea_embedded_app_config.h")
147
- set(GENERATED_INSTALLED_APPS_H "${CMAKE_BINARY_DIR}/gea_embedded_installed_apps_generated.h")
148
- execute_process(
149
- COMMAND node
150
- "${GEA_CORE}/scripts/generate-installed-app-plan.mjs"
151
- "${CMAKE_CURRENT_LIST_DIR}/../partitions.csv"
152
- "${GENERATED_INSTALLED_APPS_H}"
153
- RESULT_VARIABLE GEA_EMBEDDED_INSTALLED_APPS_RESULT
154
- )
155
- if(NOT GEA_EMBEDDED_INSTALLED_APPS_RESULT EQUAL 0)
156
- message(FATAL_ERROR "Failed to generate installed app plan from partitions.csv")
157
- endif()
158
-
159
- # The app source owns app-level defaults. On a fresh configure, create only a minimal
160
- # placeholder; the unified geatsc path can overwrite it with app-derived config
161
- # later if a native define surface lands here.
162
- if(NOT EXISTS "${GENERATED_CONFIG_H}")
163
- # Stub config header kept around because app_main.cpp still includes it.
164
- _gea_write_if_different("${GENERATED_CONFIG_H}" "#pragma once\n")
165
- endif()
166
- if(NOT EXISTS "${GENERATED_FONT_H}")
167
- _gea_write_if_different("${GENERATED_FONT_H}" [[
168
- #pragma once
169
- #define GEA_EMBEDDED_HAS_GENERATED_FONTS 1
170
- #include "graphics/font.h"
171
- #define GEA_EMBEDDED_FONT_COUNT 0
172
- #define GEA_EMBEDDED_FONT_FAMILY_COUNT 0
173
- ]])
174
- endif()
175
- if(NOT EXISTS "${GENERATED_FONT_CPP}")
176
- _gea_write_if_different("${GENERATED_FONT_CPP}" [[
177
- #include "gea_embedded_font_generated.h"
178
- namespace gea::framework::graphics::generated {
179
- void ensureLinked() {}
180
- const RasterizedFontData *lookupFont(int fontId)
181
- {
182
- (void)fontId;
183
- return nullptr;
184
- }
185
- const RasterizedFontData *lookupFontForFamily(int familyId, int sizePx)
186
- {
187
- (void)familyId;
188
- (void)sizePx;
189
- return nullptr;
190
- }
191
- int lookupFontFamily(const char *family)
192
- {
193
- (void)family;
194
- return -1;
195
- }
196
- } // namespace gea::framework::graphics::generated
197
- ]])
198
- endif()
199
- # Stub asset TU on the SRCS list before geatsc_build overwrites it with the
200
- # real (or empty) generated registry. Mirrors the font stub above.
201
- if(NOT EXISTS "${GENERATED_ASSETS_CPP}")
202
- _gea_write_if_different("${GENERATED_ASSETS_CPP}" [[
203
- // No embedded assets (stub overwritten by generate-gea-embedded-assets.mjs).
204
- ]])
205
- endif()
206
-
207
- # geatsc mode: generated app/user code is compiled from geatsc-sources.txt
208
- # into a separate archive, then linked with the firmware-side Gea adapter and host bindings.
209
- # Without app metadata (a configure driven by hand, or IDF's script-mode
210
- # requirements pass before the CLI's -D values land) JS_APP_SRC is a bare
211
- # directory; analyzing it would crash node with EISDIR and abort the
212
- # configure with a misleading "has geatsc been built?" error. The normal
213
- # pass refuses with the real reason; script mode carries on with an empty
214
- # binding set, since that pass only extracts component requirements.
215
- if(NOT EXISTS "${JS_APP_SRC}" OR IS_DIRECTORY "${JS_APP_SRC}")
216
- if(NOT CMAKE_SCRIPT_MODE_FILE)
217
- message(FATAL_ERROR "No app entry to build for '${GEA_EMBEDDED_APP}' (JS_APP_SRC='${JS_APP_SRC}'). Run this target through the gea CLI with an app: gea build --board <alias> --app <id>")
218
- endif()
219
- set(_GEA_EMBEDDED_ANALYZE_RAW "bindings=\nfeatures=")
220
- set(_GEA_EMBEDDED_ANALYZE_STATUS 0)
221
- else()
222
- execute_process(
223
- COMMAND node
224
- "${GEA_COMPILER}/dist/cli.js"
225
- analyze
226
- "${JS_APP_SRC}"
227
- --plugin
228
- "${GEA_PLUGIN}/dist/index.js"
229
- OUTPUT_VARIABLE _GEA_EMBEDDED_ANALYZE_RAW
230
- OUTPUT_STRIP_TRAILING_WHITESPACE
231
- RESULT_VARIABLE _GEA_EMBEDDED_ANALYZE_STATUS
232
- )
233
- endif()
234
- if(NOT _GEA_EMBEDDED_ANALYZE_STATUS EQUAL 0)
235
- message(FATAL_ERROR "geatsc analyze failed for app '${GEA_EMBEDDED_APP}' — has packages/geatsc been built? (run `npm --prefix packages/geatsc run build`)")
236
- endif()
237
- # `geatsc analyze` outputs two lines: `bindings=<ids>` and `features=<ids>`.
238
- string(REGEX MATCH "bindings=([^\n]*)" _ "${_GEA_EMBEDDED_ANALYZE_RAW}")
239
- set(_GEA_EMBEDDED_HOST_BINDINGS "${CMAKE_MATCH_1}")
240
- list(REMOVE_DUPLICATES _GEA_EMBEDDED_HOST_BINDINGS)
241
- if("${_GEA_EMBEDDED_HOST_BINDINGS}" MATCHES "(^|;)screen($|;)")
242
- message(FATAL_ERROR "The gea screen host binding was removed; generated apps must target the embedded UI/canvas framework")
243
- endif()
244
- string(REGEX MATCH "features=([^\n]*)" _ "${_GEA_EMBEDDED_ANALYZE_RAW}")
245
- set(_GEA_EMBEDDED_HOST_FEATURES "${CMAKE_MATCH_1}")
246
-
247
- set(APP_GENERATED_SOURCES
248
- ${GEA_EMBEDDED_APP_NATIVE_SOURCES}
249
- "${GEA_APP_ENTRY_SRC}"
250
- ${GENERATED_FONT_CPP}
251
- ${GENERATED_ASSETS_CPP}
252
- )
253
- set(GEATSC_COMPILE_OPTIONS
254
- -Wno-unused-variable
255
- -Wno-return-type
256
- -Os
257
- )
258
- set(GEATSC_COMPILE_DEFINITIONS "")
259
- if(NOT CMAKE_SCRIPT_MODE_FILE)
260
- set_source_files_properties(
261
- "${GEA_HOST}/host/rtc_esp.cpp"
262
- PROPERTIES COMPILE_OPTIONS "-Wno-unused-variable;-Os"
263
- )
264
- endif()
265
- set(GEA_EMBEDDED_HTTPS_REQUIRES "")
266
- set(GEA_EMBEDDED_HTTPS_COMPILE_DEFINITIONS "")
267
- set(GEA_EMBEDDED_BLE_COMPILE_DEFINITIONS "")
268
- if("${_GEA_EMBEDDED_HOST_BINDINGS}" MATCHES "(^|;)ble($|;)")
269
- list(APPEND GEA_EMBEDDED_BLE_COMPILE_DEFINITIONS GEA_EMBEDDED_APP_USES_BLE=1)
270
- endif()
271
- # Note: BLE driver registration + BLE controller preinit are forced from
272
- # `app_main.cpp` and `bluetooth_service.cpp` regardless of the macro above,
273
- # because `geatsc analyze` misses BLE usage routed through the internal
274
- # `runtime-surface` re-export (as `gea-embedded`'s Settings panel does).
275
- # The macro is kept narrow because `app_runner.cpp` uses it to decide
276
- # whether `gea_init` is allocated in SPIRAM (when undefined) or internal
277
- # DRAM (when defined). With 64 KB gea_init stack, forcing internal DRAM
278
- # fails — only 32 KB largest contiguous block remains after wifi/diag init.
279
- # `_GEA_EMBEDDED_HOST_FEATURES` is populated by `geatsc analyze` for the
280
- # application.
281
- #
282
- # The user-facing `GEA_EMBEDDED_HTTPS_SUPPORT` cache option lets the build
283
- # override auto-detection: `on` forces HTTPS linkage even when no
284
- # `https://` URL appears in source, `off` skips it even when one does.
285
- # `auto` (default) trusts analyze's verdict.
286
- string(TOLOWER "${GEA_EMBEDDED_HTTPS_SUPPORT}" _GEA_EMBEDDED_HTTPS_SUPPORT_MODE)
287
- set(_GEA_EMBEDDED_ENABLE_HTTPS 0)
288
- if(_GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "auto")
289
- if("${_GEA_EMBEDDED_HOST_FEATURES}" MATCHES "(^|;)https($|;)")
290
- set(_GEA_EMBEDDED_ENABLE_HTTPS 1)
291
- endif()
292
- elseif(_GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "on"
293
- OR _GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "true"
294
- OR _GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "yes"
295
- OR _GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "1")
296
- set(_GEA_EMBEDDED_ENABLE_HTTPS 1)
297
- elseif(_GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "off"
298
- OR _GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "false"
299
- OR _GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "no"
300
- OR _GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "0")
301
- set(_GEA_EMBEDDED_ENABLE_HTTPS 0)
302
- else()
303
- message(FATAL_ERROR "GEA_EMBEDDED_HTTPS_SUPPORT must be auto, on, or off")
304
- endif()
305
-
306
- if(_GEA_EMBEDDED_ENABLE_HTTPS)
307
- list(APPEND GEA_EMBEDDED_HTTPS_COMPILE_DEFINITIONS GEA_EMBEDDED_ENABLE_HTTPS=1)
308
- # `mbedtls` lands in REQUIRES iff the active app actually needs HTTPS.
309
- # The historical reason for unconditionally listing it (script-mode
310
- # discrepancy with `GEA_EMBEDDED_APP=tic-tac-toe`) is gone now that
311
- # script-mode falls through to a feature-rich gea placeholder. The
312
- # condition here is the actual signal: an app with no https:// in source
313
- # genuinely doesn't need mbedtls, and `--gc-sections` would strip it
314
- # anyway.
315
- list(APPEND GEA_EMBEDDED_HTTPS_REQUIRES mbedtls)
316
- endif()
317
-
318
- # The board's chips come from its definition: the display layer (the rgb_panel
319
- # binding IS the Display, or display_headless.cpp with no panel), the
320
- # peripherals (touch, power, IMU, expander, RTC, or their *_absent backends),
321
- # and the speaker's binding.
322
- set(GEA_P4_AUDIO_SOURCES "${GEA_EMBEDDED_ROOT}/targets/esp32/services/audio_runtime_stub.cpp")
323
- set(GEA_P4_AUDIO_DEFINITIONS GEA_EMBEDDED_AUDIO_UNUSED=1)
324
- if(GEA_CUSTOM_TARGET_AUDIO_SOURCES)
325
- set(GEA_P4_AUDIO_SOURCES ${GEA_CUSTOM_TARGET_AUDIO_SOURCES} "${GEA_HOST}/audio_runtime.cpp")
326
- set(GEA_P4_AUDIO_DEFINITIONS GEA_EMBEDDED_APP_USES_AUDIO=1 GEA_BOARD_HAS_SPEAKER=1)
327
- endif()
328
-
329
- idf_component_register(
330
- SRCS
331
- "app_main.cpp"
332
- # The MIPI-CSI camera; it declines to start when the board has none.
333
- "camera.cpp"
334
- "i2c.cpp"
335
- "launcher_button.cpp"
336
- "sdcard_mount.cpp"
337
- ${GEA_CUSTOM_TARGET_DISPLAY_SOURCES}
338
- ${GEA_CUSTOM_TARGET_PERIPHERAL_SOURCES}
339
- ${GEA_P4_AUDIO_SOURCES}
340
- "${GEA_EMBEDDED_ROOT}/targets/esp32/apps/app_manager.cpp"
341
- "${GEA_EMBEDDED_ROOT}/targets/esp32/connectivity/diagnostics_transport.cpp"
342
- # WiFi station driver (registerDriver / WifiStation). On P4 its esp_wifi_*
343
- # calls resolve to esp_wifi_remote (C6 over esp_hosted SDIO). Native-only
344
- # osi_funcs stack-bump is guarded by CONFIG_SOC_WIFI_SUPPORTED inside.
345
- "${GEA_EMBEDDED_ROOT}/targets/esp32/connectivity/wifi.cpp"
346
- # @geastack framework C/C++ sources — single source of truth: @geastack/core/gea_sources.sh
347
- # (resolved via node_modules, shared with the web build).
348
- ${GEA_FW_APP_SENSITIVE_SOURCES}
349
- # esp32-specific host shims (generic host + services come from the manifest):
350
- "${GEA_HOST}/host/rtc_esp.cpp"
351
- "${GEA_EMBEDDED_ROOT}/targets/esp32/services/app_runner.cpp"
352
- "${GEA_EMBEDDED_ROOT}/targets/esp32/services/app_state.cpp"
353
- "${GEA_EMBEDDED_ROOT}/targets/esp32/services/battery_service.cpp"
354
- "${GEA_EMBEDDED_ROOT}/targets/esp32/services/device_control.cpp"
355
- "${GEA_EMBEDDED_ROOT}/targets/esp32/services/frame_scheduler.cpp"
356
- "${GEA_EMBEDDED_ROOT}/targets/esp32/services/memory.cpp"
357
- "${GEA_EMBEDDED_ROOT}/targets/esp32/services/ota.cpp"
358
- # ota.cpp stages the image through ota_image.cpp (and its debug hooks).
359
- "${GEA_EMBEDDED_ROOT}/targets/esp32/services/ota_image.cpp"
360
- "${GEA_EMBEDDED_ROOT}/targets/esp32/services/storage_service.cpp"
361
- "${GEA_EMBEDDED_ROOT}/targets/esp32/services/heap.cpp"
362
- ${APP_GENERATED_SOURCES}
363
- INCLUDE_DIRS
364
- ${GEA_CUSTOM_TARGET_INCLUDE_DIR}
365
- "include"
366
- "${GEA_EMBEDDED_ROOT}/targets/esp32"
367
- ${GEA_FW_INCLUDE_DIRS}
368
- "${GEA_CHIPS}"
369
- ${GENERATED_APP_DIR}
370
- ${CMAKE_BINARY_DIR}
371
- REQUIRES
372
- gea_framework
373
- esp_system
374
- esp_timer
375
- freertos
376
- lwip
377
- esp_http_server
378
- esp_http_client
379
- ${GEA_EMBEDDED_HTTPS_REQUIRES}
380
- app_update
381
- # esp32/services/ota.cpp reads the flash through esp_flash.h.
382
- spi_flash
383
- esp_mm
384
- esp_netif
385
- esp_event
386
- # WiFi: esp_wifi for the esp_wifi.h API headers; on P4 the implementation
387
- # is provided by esp_wifi_remote (esp_hosted SDIO link to the onboard C6).
388
- esp_wifi
389
- esp_wifi_remote
390
- esp_hosted
391
- nvs_flash
392
- esp_lcd
393
- driver
394
- esp_driver_ppa
395
- esp_driver_i2c
396
- esp_driver_usb_serial_jtag
397
- esp_driver_i2s
398
- esp_driver_ledc
399
- esp_driver_sdmmc
400
- sdmmc
401
- fatfs
402
- esp_codec_dev
403
- esp_video
404
- ${GEA_CUSTOM_TARGET_REQUIRES}
405
- LDFRAGMENTS
406
- )
407
-
408
- if(TARGET idf::espressif__esp_ipa AND TARGET idf::esp_hal_cam)
409
- idf_component_get_property(_GEA_ESP_IPA_LIB espressif__esp_ipa COMPONENT_LIB)
410
- target_link_libraries(${_GEA_ESP_IPA_LIB} PUBLIC idf::esp_hal_cam)
411
- endif()
412
-
413
- if(TARGET idf::espressif__esp_video AND TARGET idf::esp_driver_gpio)
414
- idf_component_get_property(_GEA_ESP_VIDEO_LIB espressif__esp_video COMPONENT_LIB)
415
- target_link_libraries(${_GEA_ESP_VIDEO_LIB} PUBLIC idf::esp_driver_gpio)
416
- target_compile_definitions(${_GEA_ESP_VIDEO_LIB} PRIVATE CAM_CTLR_COLOR_YUV422=CAM_CTLR_COLOR_YUV422_UYVY)
417
- endif()
418
-
419
- # Enable exFAT in FatFs (to mount exFAT microSD cards) WITHOUT editing the ESP-IDF
420
- # tree: IDF has no Kconfig for FF_FS_EXFAT, so we force-include a repo-local ffconf.h
421
- # (FF_FS_EXFAT=1) into the fatfs component. Its `#ifndef _FFCONF_DEFINED` guard makes
422
- # IDF's own ffconf.h a no-op once ours is included first.
423
- if(TARGET idf::fatfs)
424
- idf_component_get_property(_GEA_FATFS_LIB fatfs COMPONENT_LIB)
425
- target_compile_options(${_GEA_FATFS_LIB} PRIVATE
426
- "SHELL:-include ${CMAKE_CURRENT_LIST_DIR}/fatfs_ffconf.h")
427
- endif()
428
-
429
- set(GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE 0)
430
- if(DEFINED ENV{GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG})
431
- set(GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE "$ENV{GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG}")
432
- endif()
433
-
434
- target_compile_definitions(${COMPONENT_LIB} PRIVATE
435
- ${GEA_CUSTOM_TARGET_COMPILE_DEFINITIONS}
436
- ${GEA_P4_AUDIO_DEFINITIONS}
437
- GEA_EMBEDDED_BOARD_ID="${GEA_EMBEDDED_CPP_BOARD}"
438
- GEA_CPP_ENABLE_REGEX=0
439
- GEA_CPP_USE_TO_CHARS_DOUBLE=0
440
- GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG=${GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE}
441
- GEA_EMBEDDED_CSS_DEVICE_PIXEL_RATIO=${GEA_EMBEDDED_CSS_DEVICE_PIXEL_RATIO}
442
- GEA_EMBEDDED_HAS_GENERATED_FONTS=1
443
- # WiFi re-enabled for network apps (e.g. maps OSM tiles). Was =1 to isolate
444
- # whether WiFi PSRAM/cache-bus contention starves the direct-PSRAM SPI flush
445
- # FIFO; the WPA2-auth stack overflow is already mitigated by the osi_funcs
446
- # task-stack bump in wifi.cpp. Re-add `GEA_EMBEDDED_WIFI_DISABLED=1` here if
447
- # WiFi DMA/ISR traffic regresses the display flush. (#ifdef/#ifndef key on
448
- # defined-ness, so this must be ABSENT — not =0 — to enable WiFi.)
449
- GEA_EMBEDDED_BLE_DISABLED=1
450
- GEA_EMBEDDED_AUDIO_DISABLED=0
451
- GEA_EMBEDDED_DEFAULT_FRAME_INTERVAL_US=16000
452
- GEA_EMBEDDED_FRAME_SCHEDULER_USE_ESP_TIMER=1
453
- GEA_EMBEDDED_FRAME_SCHEDULER_IDLE_YIELD_TICKS=0
454
- GEA_EMBEDDED_FRAME_SCHEDULER_MAX_CATCHUP_FRAMES_BEFORE_YIELD=60
455
- GEA_EMBEDDED_DIRTY_REGION_MAX_RECTS=64
456
- GEA_EMBEDDED_FLUSH_ANCHOR_LEFT_PARTIAL_RECTS=0
457
- GEA_EMBEDDED_RENDER_PARALLEL_MIN_ROWS=48
458
- GEA_EMBEDDED_RENDER_PARALLEL_MIN_PIXELS=24576
459
- # Fallback FreeRTOS frame ticker affinity when the esp_timer scheduler is disabled.
460
- GEA_EMBEDDED_APP_FRAME_TASK_CORE=0
461
- # Was =1 from an old display-pacing experiment (f06ad9724) that disabled the
462
- # then-broken queueFrameEvent catch-up. =0 re-enables catch-up, now driven by
463
- # the work-based, event-loop graceful-overrun path (frame_scheduler/runtime).
464
- GEA_EMBEDDED_FRAME_SCHEDULER_DROP_CATCHUP_FRAMES=0
465
- GEA_EMBEDDED_APP_FRAME_TASK_PRIORITY=23
466
- ${GEA_EMBEDDED_BLE_COMPILE_DEFINITIONS}
467
- ${GEA_EMBEDDED_HTTPS_COMPILE_DEFINITIONS}
468
- )
469
-
470
- # Production lockdown: gated by CONFIG_GEA_EMBEDDED_PRODUCTION_LOCKDOWN (sdkconfig.defaults).
471
- # When enabled, adds defines that compile out perf/heap logs and disable diagnostics server.
472
- if(CONFIG_GEA_EMBEDDED_PRODUCTION_LOCKDOWN)
473
- target_compile_definitions(${COMPONENT_LIB} PRIVATE
474
- GEA_EMBEDDED_FRAME_SCHEDULER_PERF_LOG=0
475
- GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG=0
476
- GEA_FRAME_PERF_LOG=0
477
- GEA_EMBEDDED_DIAGNOSTICS_DISABLED=1
478
- )
479
- endif()
480
-
481
- target_compile_options(${COMPONENT_LIB} PRIVATE
482
- ${GEA_XTENSA_LITERALS} # -mtext-section-literals on xtensa, empty on riscv (see gea_framework.cmake)
483
- -Wno-unused-parameter
484
- -Wno-sign-compare
485
- -Wno-missing-field-initializers
486
- -Wno-implicit-fallthrough
487
- $<$<COMPILE_LANGUAGE:C>:-Wno-old-style-declaration>
488
- -Wno-misleading-indentation
489
- -Wno-type-limits
490
- -Wno-maybe-uninitialized
491
- -Wno-calloc-transposed-args
492
- -Wno-unused-function
493
- -Wno-clobbered
494
- )
495
-
496
- # --- App compilation: vite-plugin-gea -> geatsc ---
497
-
498
- _gea_collect_app_sources(_ACTIVE_APP_SRCS "${GEA_EMBEDDED_APP_DIR}")
499
- _gea_collect_app_assets(_ACTIVE_APP_ASSETS "${GEA_EMBEDDED_APP_DIR}")
500
- # The Gea compiler emits JS and IR, then geatsc emits C++. We use a stamp file as
501
- # the canonical OUTPUT because geatsc now writes a source manifest plus multiple
502
- # translation units. The generated archive consumes geatsc-sources.txt after this
503
- # command has completed.
504
- set(_GEATSC_BIN "${GEA_COMPILER}/dist/cli.js")
505
- set(_GEATSC_BUILD_STAMP "${GENERATED_APP_DIR}/geatsc_build.stamp")
506
- set(_GEA_VITE_GEATSC_SCRIPT "${GEA_CORE}/scripts/build-gea-vite-geatsc.mjs")
507
- file(GLOB_RECURSE _GEATSC_DIST_SRCS CONFIGURE_DEPENDS
508
- "${GEA_COMPILER}/dist/*.js"
509
- "${GEA_COMPILER}/dist/targets/cpp/runtime/*.cpp"
510
- "${GEA_PLUGIN}/dist/*.js"
511
- )
512
- add_custom_command(
513
- OUTPUT ${_GEATSC_BUILD_STAMP}
514
- COMMAND node ${_GEA_VITE_GEATSC_SCRIPT}
515
- --build-config "${GEA_BUILD_CONFIG_JSON}"
516
- --app-dir ${GEA_EMBEDDED_APP_DIR}
517
- --entry ${GEA_EMBEDDED_APP_ENTRY}
518
- --cpp-board "${GEA_EMBEDDED_CPP_BOARD}"
519
- --out-dir ${GENERATED_APP_DIR}
520
- --geatsc-bin ${_GEATSC_BIN}
521
- --font-device-pixel-ratio ${GEA_EMBEDDED_CSS_DEVICE_PIXEL_RATIO}
522
- --pixel-panel-endian ${GEA_CUSTOM_TARGET_PIXEL_PANEL_ENDIAN}
523
- ${GEA_EMBEDDED_FONT_VIEWPORT_ARGS}
524
- --gea-ir-backend
525
- # gea.compilerPlugins: an app's own geatsc plugins, e.g. the one that
526
- # declares its native host-function boundary. Empty for most apps.
527
- ${GEA_EMBEDDED_APP_GEATSC_PLUGIN_ARGS}
528
- COMMAND ${CMAKE_COMMAND} -E touch ${_GEATSC_BUILD_STAMP}
529
- DEPENDS
530
- "${GEA_BUILD_CONFIG_JSON}"
531
- ${GEA_EMBEDDED_APP_GEATSC_PLUGINS}
532
- ${_ACTIVE_APP_SRCS}
533
- ${_ACTIVE_APP_ASSETS}
534
- ${_GEATSC_BIN}
535
- ${_GEATSC_DIST_SRCS}
536
- ${_GEA_COMPILER_DEP_SRCS}
537
- ${_GEA_FONT_ASSETS}
538
- BYPRODUCTS
539
- "${GEATSC_SOURCE_LIST}"
540
- "${GENERATED_APP_DIR}/entry.cpp"
541
- "${GENERATED_APP_DIR}/generated_support.hpp"
542
- "${GENERATED_APP_DIR}/runtime.cpp"
543
- "${GENERATED_APP_DIR}/runtime_pch.h"
544
- ${GENERATED_CONFIG_H}
545
- ${GENERATED_FONT_CPP}
546
- ${GENERATED_FONT_H}
547
- ${GENERATED_ASSETS_CPP}
548
- "${GENERATED_APP_DIR}/gea-vite-bundle.js"
549
- COMMENT "Compiling ${GEA_EMBEDDED_APP}: TSX -> JS via vite-plugin-gea -> C++ via geatsc"
550
- VERBATIM
551
- )
552
- add_custom_target(geatsc_build ALL DEPENDS ${_GEATSC_BUILD_STAMP})
553
- gea_geatsc_add_generated_archive(
554
- TARGET ${COMPONENT_LIB}
555
- NAME geatsc_active_archive
556
- SOURCE_LIST "${GEATSC_SOURCE_LIST}"
557
- OUTPUT "${GEATSC_ARCHIVE}"
558
- DEPENDS ${_GEATSC_BUILD_STAMP}
559
- COMPILE_OPTIONS ${GEATSC_COMPILE_OPTIONS}
560
- COMPILE_DEFINITIONS ${GEATSC_COMPILE_DEFINITIONS}
561
- )
562
- add_dependencies(geatsc_active_archive geatsc_build)
563
-
564
- gea_framework_inherit_build_settings()
@@ -1,14 +0,0 @@
1
- menu "Gea Embedded"
2
-
3
- config GEA_EMBEDDED_PRODUCTION_LOCKDOWN
4
- bool "Production lockdown"
5
- default n
6
- help
7
- Compile out Gea frame/perf logs, heap diagnostics, and the
8
- diagnostics server for production firmware. Local development builds
9
- should leave this disabled so serial monitor and VS Code launch
10
- tasks show fps and diagnostic logs.
11
-
12
- endmenu
13
-
14
-