@geastack/targets 0.1.77

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.
Files changed (348) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +83 -0
  3. package/package.json +50 -0
  4. package/targets/cmake/geatsc-generated-archive-build.mjs +614 -0
  5. package/targets/cmake/geatsc_generated_archive.cmake +116 -0
  6. package/targets/cmake/geatsc_generated_archive_build.cmake +50 -0
  7. package/targets/esp32/app_project.cmake +33 -0
  8. package/targets/esp32/apps/app_manager.cpp +188 -0
  9. package/targets/esp32/apps/app_manager.h +10 -0
  10. package/targets/esp32/chip_bindings/README.md +58 -0
  11. package/targets/esp32/chip_bindings/audio/es8311.cpp +556 -0
  12. package/targets/esp32/chip_bindings/displays/co5300.cpp +510 -0
  13. package/targets/esp32/chip_bindings/displays/co5300.h +47 -0
  14. package/targets/esp32/chip_bindings/displays/co5300_async_stream.inc +79 -0
  15. package/targets/esp32/chip_bindings/displays/qspi_panel.h +65 -0
  16. package/targets/esp32/chip_bindings/displays/sh8601.cpp +583 -0
  17. package/targets/esp32/chip_bindings/displays/sh8601.h +36 -0
  18. package/targets/esp32/chip_bindings/gps/lc76g.cpp +296 -0
  19. package/targets/esp32/chip_bindings/gps/lc76g.h +7 -0
  20. package/targets/esp32/chip_bindings/imu/bmi270.cpp +299 -0
  21. package/targets/esp32/chip_bindings/imu/bmi270_config.inl +439 -0
  22. package/targets/esp32/chip_bindings/imu/qmi8658.cpp +213 -0
  23. package/targets/esp32/chip_bindings/power/axp2101.cpp +185 -0
  24. package/targets/esp32/chip_bindings/touch/cst9217.cpp +229 -0
  25. package/targets/esp32/chip_bindings/touch/cst9217_controller.h +78 -0
  26. package/targets/esp32/chip_bindings/touch/ft3168.cpp +340 -0
  27. package/targets/esp32/chip_bindings/touch/ft3168_controller.h +103 -0
  28. package/targets/esp32/chip_bindings/touch/ft6336.cpp +310 -0
  29. package/targets/esp32/chip_bindings/touch/ft6336_controller.h +90 -0
  30. package/targets/esp32/components/gea_framework/CMakeLists.txt +62 -0
  31. package/targets/esp32/connectivity/ble_hid.cpp +2916 -0
  32. package/targets/esp32/connectivity/ble_hid.h +8 -0
  33. package/targets/esp32/connectivity/diagnostics_transport.cpp +523 -0
  34. package/targets/esp32/connectivity/diagnostics_transport_offline.cpp +108 -0
  35. package/targets/esp32/connectivity/wifi.cpp +615 -0
  36. package/targets/esp32/connectivity/wifi_debug_offline.cpp +37 -0
  37. package/targets/esp32/connectivity/wifi_task_stack.h +119 -0
  38. package/targets/esp32/display.cpp +6010 -0
  39. package/targets/esp32/display_headless.cpp +468 -0
  40. package/targets/esp32/gea/platform_random.h +11 -0
  41. package/targets/esp32/gea_framework.cmake +382 -0
  42. package/targets/esp32/gpio.cpp +229 -0
  43. package/targets/esp32/host_sources.cmake +35 -0
  44. package/targets/esp32/imu_absent.cpp +36 -0
  45. package/targets/esp32/ldfragments/gea_ui_state_external.lf +35 -0
  46. package/targets/esp32/memory_config.h +64 -0
  47. package/targets/esp32/power_absent.cpp +22 -0
  48. package/targets/esp32/sdk-patches/0001-esp_ptr_dma_capable-accept-PSRAM.patch +70 -0
  49. package/targets/esp32/sdk-patches/0002-gdma-access_ext_mem-spi_master.patch +59 -0
  50. package/targets/esp32/sdk-patches/README.md +127 -0
  51. package/targets/esp32/services/app_runner.cpp +248 -0
  52. package/targets/esp32/services/app_state.cpp +56 -0
  53. package/targets/esp32/services/audio_runtime_stub.cpp +86 -0
  54. package/targets/esp32/services/battery_service.cpp +31 -0
  55. package/targets/esp32/services/device_control.cpp +1896 -0
  56. package/targets/esp32/services/device_control.h +31 -0
  57. package/targets/esp32/services/frame_scheduler.cpp +1571 -0
  58. package/targets/esp32/services/heap.cpp +129 -0
  59. package/targets/esp32/services/memory.cpp +103 -0
  60. package/targets/esp32/services/ota.cpp +840 -0
  61. package/targets/esp32/services/ota_image.cpp +162 -0
  62. package/targets/esp32/services/ota_image.h +16 -0
  63. package/targets/esp32/services/storage_service.cpp +159 -0
  64. package/targets/esp32/touch_absent.cpp +44 -0
  65. package/targets/esp32-m5stack-m5paper/CMakeLists.txt +10 -0
  66. package/targets/esp32-m5stack-m5paper/README.md +55 -0
  67. package/targets/esp32-m5stack-m5paper/dependencies.lock +76 -0
  68. package/targets/esp32-m5stack-m5paper/main/CMakeLists.txt +46 -0
  69. package/targets/esp32-m5stack-m5paper/main/Kconfig.projbuild +10 -0
  70. package/targets/esp32-m5stack-m5paper/main/app_main.cpp +114 -0
  71. package/targets/esp32-m5stack-m5paper/main/audio_stub.cpp +27 -0
  72. package/targets/esp32-m5stack-m5paper/main/buttons.cpp +111 -0
  73. package/targets/esp32-m5stack-m5paper/main/display.cpp +1074 -0
  74. package/targets/esp32-m5stack-m5paper/main/i2c.cpp +36 -0
  75. package/targets/esp32-m5stack-m5paper/main/idf_component.yml +7 -0
  76. package/targets/esp32-m5stack-m5paper/main/imu_stub.cpp +20 -0
  77. package/targets/esp32-m5stack-m5paper/main/include/board.h +100 -0
  78. package/targets/esp32-m5stack-m5paper/main/include/buttons.h +8 -0
  79. package/targets/esp32-m5stack-m5paper/main/launcher_button.cpp +82 -0
  80. package/targets/esp32-m5stack-m5paper/main/m5paper_psram.lf +20 -0
  81. package/targets/esp32-m5stack-m5paper/main/power.cpp +73 -0
  82. package/targets/esp32-m5stack-m5paper/main/sdcard_mount.cpp +82 -0
  83. package/targets/esp32-m5stack-m5paper/main/touch.cpp +279 -0
  84. package/targets/esp32-m5stack-m5paper/partitions.csv +9 -0
  85. package/targets/esp32-m5stack-m5paper/sdkconfig.defaults +84 -0
  86. package/targets/esp32-p4-m5stack-tab5/CMakeLists.txt +10 -0
  87. package/targets/esp32-p4-m5stack-tab5/dependencies.lock +276 -0
  88. package/targets/esp32-p4-m5stack-tab5/main/CMakeLists.txt +586 -0
  89. package/targets/esp32-p4-m5stack-tab5/main/Kconfig.projbuild +12 -0
  90. package/targets/esp32-p4-m5stack-tab5/main/app_main.cpp +177 -0
  91. package/targets/esp32-p4-m5stack-tab5/main/camera.cpp +2025 -0
  92. package/targets/esp32-p4-m5stack-tab5/main/display.cpp +4033 -0
  93. package/targets/esp32-p4-m5stack-tab5/main/fatfs_ffconf.h +383 -0
  94. package/targets/esp32-p4-m5stack-tab5/main/i2c.cpp +39 -0
  95. package/targets/esp32-p4-m5stack-tab5/main/idf_component.yml +21 -0
  96. package/targets/esp32-p4-m5stack-tab5/main/include/board.h +130 -0
  97. package/targets/esp32-p4-m5stack-tab5/main/include/tab5_drivers.h +68 -0
  98. package/targets/esp32-p4-m5stack-tab5/main/include/wifi_config.h.example +5 -0
  99. package/targets/esp32-p4-m5stack-tab5/main/launcher_button.cpp +188 -0
  100. package/targets/esp32-p4-m5stack-tab5/main/power.cpp +22 -0
  101. package/targets/esp32-p4-m5stack-tab5/main/sdcard_mount.cpp +125 -0
  102. package/targets/esp32-p4-m5stack-tab5/main/tab5_audio.cpp +345 -0
  103. package/targets/esp32-p4-m5stack-tab5/main/tab5_drivers.cpp +871 -0
  104. package/targets/esp32-p4-m5stack-tab5/main/tab5_imu.cpp +246 -0
  105. package/targets/esp32-p4-m5stack-tab5/main/touch.cpp +206 -0
  106. package/targets/esp32-p4-m5stack-tab5/partitions.csv +12 -0
  107. package/targets/esp32-p4-m5stack-tab5/sdkconfig.defaults +128 -0
  108. package/targets/esp32-p4-waveshare-touch-lcd-3.5/CMakeLists.txt +19 -0
  109. package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/0001-esp_video-csi-raw-passthrough-p4-rev-lt-v3.patch +28 -0
  110. package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/README.md +45 -0
  111. package/targets/esp32-p4-waveshare-touch-lcd-3.5/component-patches/apply.sh +37 -0
  112. package/targets/esp32-p4-waveshare-touch-lcd-3.5/dependencies.lock +196 -0
  113. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/CMakeLists.txt +562 -0
  114. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/Kconfig.projbuild +12 -0
  115. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/app_main.cpp +166 -0
  116. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/camera.cpp +2105 -0
  117. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/display.cpp +1730 -0
  118. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/fatfs_ffconf.h +383 -0
  119. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/i2c.cpp +39 -0
  120. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/idf_component.yml +11 -0
  121. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/board.h +87 -0
  122. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/panel_native.h +59 -0
  123. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/include/wifi_config.h.example +5 -0
  124. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/launcher_button.cpp +191 -0
  125. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/power.cpp +15 -0
  126. package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/touch.cpp +306 -0
  127. package/targets/esp32-p4-waveshare-touch-lcd-3.5/partitions.csv +13 -0
  128. package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/README.md +22 -0
  129. package/targets/esp32-p4-waveshare-touch-lcd-3.5/patches/espressif__esp_video-csi-bypass.patch +28 -0
  130. package/targets/esp32-p4-waveshare-touch-lcd-3.5/sdkconfig.defaults +109 -0
  131. package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/README-camera-capture.md +84 -0
  132. package/targets/esp32-p4-waveshare-touch-lcd-3.5/tools/capture-camera.py +369 -0
  133. package/targets/esp32-p4-waveshare-touch-lcd-7/CMakeLists.txt +10 -0
  134. package/targets/esp32-p4-waveshare-touch-lcd-7/dependencies.lock +258 -0
  135. package/targets/esp32-p4-waveshare-touch-lcd-7/main/CMakeLists.txt +577 -0
  136. package/targets/esp32-p4-waveshare-touch-lcd-7/main/Kconfig.projbuild +12 -0
  137. package/targets/esp32-p4-waveshare-touch-lcd-7/main/app_main.cpp +177 -0
  138. package/targets/esp32-p4-waveshare-touch-lcd-7/main/camera.cpp +1935 -0
  139. package/targets/esp32-p4-waveshare-touch-lcd-7/main/display.cpp +2832 -0
  140. package/targets/esp32-p4-waveshare-touch-lcd-7/main/fatfs_ffconf.h +383 -0
  141. package/targets/esp32-p4-waveshare-touch-lcd-7/main/i2c.cpp +39 -0
  142. package/targets/esp32-p4-waveshare-touch-lcd-7/main/idf_component.yml +23 -0
  143. package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/board.h +68 -0
  144. package/targets/esp32-p4-waveshare-touch-lcd-7/main/include/wifi_config.h.example +5 -0
  145. package/targets/esp32-p4-waveshare-touch-lcd-7/main/launcher_button.cpp +191 -0
  146. package/targets/esp32-p4-waveshare-touch-lcd-7/main/power.cpp +15 -0
  147. package/targets/esp32-p4-waveshare-touch-lcd-7/main/sdcard_mount.cpp +125 -0
  148. package/targets/esp32-p4-waveshare-touch-lcd-7/main/touch.cpp +332 -0
  149. package/targets/esp32-p4-waveshare-touch-lcd-7/partitions.csv +12 -0
  150. package/targets/esp32-p4-waveshare-touch-lcd-7/sdkconfig.defaults +122 -0
  151. package/targets/esp32-p4-waveshare-touch-lcd-7/tools/README-camera-capture.md +84 -0
  152. package/targets/esp32-p4-waveshare-touch-lcd-7/tools/capture-camera.py +369 -0
  153. package/targets/esp32-s3-devkit-n16r8.json +31 -0
  154. package/targets/esp32-s3-elecrow-rotary-2.1/CMakeLists.txt +10 -0
  155. package/targets/esp32-s3-elecrow-rotary-2.1/dependencies.lock +40 -0
  156. package/targets/esp32-s3-elecrow-rotary-2.1/main/CMakeLists.txt +549 -0
  157. package/targets/esp32-s3-elecrow-rotary-2.1/main/Kconfig.projbuild +12 -0
  158. package/targets/esp32-s3-elecrow-rotary-2.1/main/app_main.cpp +187 -0
  159. package/targets/esp32-s3-elecrow-rotary-2.1/main/display_rgb.cpp +1338 -0
  160. package/targets/esp32-s3-elecrow-rotary-2.1/main/i2c.cpp +39 -0
  161. package/targets/esp32-s3-elecrow-rotary-2.1/main/idf_component.yml +5 -0
  162. package/targets/esp32-s3-elecrow-rotary-2.1/main/include/board.h +142 -0
  163. package/targets/esp32-s3-elecrow-rotary-2.1/main/include/pcf8574.h +16 -0
  164. package/targets/esp32-s3-elecrow-rotary-2.1/main/include/rotary_encoder.h +7 -0
  165. package/targets/esp32-s3-elecrow-rotary-2.1/main/launcher_button.cpp +191 -0
  166. package/targets/esp32-s3-elecrow-rotary-2.1/main/pcf8574.cpp +86 -0
  167. package/targets/esp32-s3-elecrow-rotary-2.1/main/platform_stubs.cpp +47 -0
  168. package/targets/esp32-s3-elecrow-rotary-2.1/main/rotary_encoder.cpp +135 -0
  169. package/targets/esp32-s3-elecrow-rotary-2.1/main/touch.cpp +250 -0
  170. package/targets/esp32-s3-elecrow-rotary-2.1/partitions.csv +8 -0
  171. package/targets/esp32-s3-elecrow-rotary-2.1/sdkconfig.defaults +116 -0
  172. package/targets/esp32-s3-epaper-1.54/CMakeLists.txt +10 -0
  173. package/targets/esp32-s3-epaper-1.54/dependencies.lock +76 -0
  174. package/targets/esp32-s3-epaper-1.54/main/CMakeLists.txt +691 -0
  175. package/targets/esp32-s3-epaper-1.54/main/Kconfig.projbuild +12 -0
  176. package/targets/esp32-s3-epaper-1.54/main/app_main.cpp +181 -0
  177. package/targets/esp32-s3-epaper-1.54/main/buttons.cpp +144 -0
  178. package/targets/esp32-s3-epaper-1.54/main/display.cpp +1281 -0
  179. package/targets/esp32-s3-epaper-1.54/main/fatfs_ffconf.h +377 -0
  180. package/targets/esp32-s3-epaper-1.54/main/i2c.cpp +39 -0
  181. package/targets/esp32-s3-epaper-1.54/main/idf_component.yml +7 -0
  182. package/targets/esp32-s3-epaper-1.54/main/imu_stub.cpp +21 -0
  183. package/targets/esp32-s3-epaper-1.54/main/include/board.h +119 -0
  184. package/targets/esp32-s3-epaper-1.54/main/include/buttons.h +9 -0
  185. package/targets/esp32-s3-epaper-1.54/main/include/wifi_config.h.example +5 -0
  186. package/targets/esp32-s3-epaper-1.54/main/launcher_button.cpp +191 -0
  187. package/targets/esp32-s3-epaper-1.54/main/power.cpp +15 -0
  188. package/targets/esp32-s3-epaper-1.54/main/sdcard_mount.cpp +89 -0
  189. package/targets/esp32-s3-epaper-1.54/main/touch.cpp +299 -0
  190. package/targets/esp32-s3-epaper-1.54/partitions.csv +8 -0
  191. package/targets/esp32-s3-epaper-1.54/sdkconfig.defaults +217 -0
  192. package/targets/esp32-s3-lilygo-t-display-s3-long/CMakeLists.txt +10 -0
  193. package/targets/esp32-s3-lilygo-t-display-s3-long/README.md +29 -0
  194. package/targets/esp32-s3-lilygo-t-display-s3-long/dependencies.lock +116 -0
  195. package/targets/esp32-s3-lilygo-t-display-s3-long/main/CMakeLists.txt +90 -0
  196. package/targets/esp32-s3-lilygo-t-display-s3-long/main/idf_component.yml +7 -0
  197. package/targets/esp32-s3-lilygo-t-display-s3-long/main/include/board.h +61 -0
  198. package/targets/esp32-s3-lilygo-t-display-s3-long/main/touch.cpp +299 -0
  199. package/targets/esp32-s3-lilygo-t-display-s3-long/partitions.csv +7 -0
  200. package/targets/esp32-s3-lilygo-t-display-s3-long/sdkconfig.defaults +50 -0
  201. package/targets/esp32-s3-lilygo-t5-epaper-4.7/CMakeLists.txt +12 -0
  202. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/CMakeLists.txt +17 -0
  203. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.c +269 -0
  204. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/ed047tc1.h +142 -0
  205. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.c +1114 -0
  206. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/epd_driver.h +410 -0
  207. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/gea_epd.c +989 -0
  208. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.c +489 -0
  209. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/i2s_data_bus.h +104 -0
  210. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.c +136 -0
  211. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/rmt_pulse.h +78 -0
  212. package/targets/esp32-s3-lilygo-t5-epaper-4.7/components/epd_driver/utilities.h +49 -0
  213. package/targets/esp32-s3-lilygo-t5-epaper-4.7/dependencies.lock +35 -0
  214. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/CMakeLists.txt +30 -0
  215. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/Kconfig.projbuild +10 -0
  216. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/app_main.cpp +95 -0
  217. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/audio_stub.cpp +27 -0
  218. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/buttons.cpp +40 -0
  219. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/display.cpp +627 -0
  220. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/i2c.cpp +36 -0
  221. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/idf_component.yml +4 -0
  222. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/imu_stub.cpp +20 -0
  223. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/board.h +85 -0
  224. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/include/buttons.h +8 -0
  225. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/launcher_button.cpp +82 -0
  226. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/power.cpp +36 -0
  227. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/sdcard_mount.cpp +90 -0
  228. package/targets/esp32-s3-lilygo-t5-epaper-4.7/main/touch.cpp +293 -0
  229. package/targets/esp32-s3-lilygo-t5-epaper-4.7/partitions.csv +9 -0
  230. package/targets/esp32-s3-lilygo-t5-epaper-4.7/sdkconfig.defaults +217 -0
  231. package/targets/esp32-s3-m5stack-papers3/CMakeLists.txt +13 -0
  232. package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/CMakeLists.txt +5 -0
  233. package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/include/papers3_epd.h +74 -0
  234. package/targets/esp32-s3-m5stack-papers3/components/papers3_epd/papers3_epd.c +671 -0
  235. package/targets/esp32-s3-m5stack-papers3/dependencies.lock +76 -0
  236. package/targets/esp32-s3-m5stack-papers3/main/CMakeLists.txt +64 -0
  237. package/targets/esp32-s3-m5stack-papers3/main/Kconfig.projbuild +10 -0
  238. package/targets/esp32-s3-m5stack-papers3/main/app_main.cpp +96 -0
  239. package/targets/esp32-s3-m5stack-papers3/main/audio_stub.cpp +27 -0
  240. package/targets/esp32-s3-m5stack-papers3/main/buttons.cpp +49 -0
  241. package/targets/esp32-s3-m5stack-papers3/main/display.cpp +706 -0
  242. package/targets/esp32-s3-m5stack-papers3/main/i2c.cpp +36 -0
  243. package/targets/esp32-s3-m5stack-papers3/main/idf_component.yml +14 -0
  244. package/targets/esp32-s3-m5stack-papers3/main/imu.cpp +351 -0
  245. package/targets/esp32-s3-m5stack-papers3/main/include/board.h +101 -0
  246. package/targets/esp32-s3-m5stack-papers3/main/include/buttons.h +8 -0
  247. package/targets/esp32-s3-m5stack-papers3/main/launcher_button.cpp +96 -0
  248. package/targets/esp32-s3-m5stack-papers3/main/power.cpp +102 -0
  249. package/targets/esp32-s3-m5stack-papers3/main/sdcard_mount.cpp +88 -0
  250. package/targets/esp32-s3-m5stack-papers3/main/touch.cpp +287 -0
  251. package/targets/esp32-s3-m5stack-papers3/partitions.csv +9 -0
  252. package/targets/esp32-s3-m5stack-papers3/sdkconfig.defaults +232 -0
  253. package/targets/esp32-s3-m5stack-sticks3/CMakeLists.txt +10 -0
  254. package/targets/esp32-s3-m5stack-sticks3/dependencies.lock +51 -0
  255. package/targets/esp32-s3-m5stack-sticks3/main/CMakeLists.txt +51 -0
  256. package/targets/esp32-s3-m5stack-sticks3/main/Kconfig.projbuild +12 -0
  257. package/targets/esp32-s3-m5stack-sticks3/main/app_main.cpp +130 -0
  258. package/targets/esp32-s3-m5stack-sticks3/main/buttons.cpp +101 -0
  259. package/targets/esp32-s3-m5stack-sticks3/main/display.cpp +1391 -0
  260. package/targets/esp32-s3-m5stack-sticks3/main/i2c.cpp +39 -0
  261. package/targets/esp32-s3-m5stack-sticks3/main/idf_component.yml +8 -0
  262. package/targets/esp32-s3-m5stack-sticks3/main/imu_stub.cpp +9 -0
  263. package/targets/esp32-s3-m5stack-sticks3/main/include/board.h +89 -0
  264. package/targets/esp32-s3-m5stack-sticks3/main/include/buttons.h +9 -0
  265. package/targets/esp32-s3-m5stack-sticks3/main/launcher_button.cpp +191 -0
  266. package/targets/esp32-s3-m5stack-sticks3/main/power.cpp +15 -0
  267. package/targets/esp32-s3-m5stack-sticks3/main/sdcard_mount.cpp +8 -0
  268. package/targets/esp32-s3-m5stack-sticks3/main/touch.cpp +65 -0
  269. package/targets/esp32-s3-m5stack-sticks3/partitions.csv +8 -0
  270. package/targets/esp32-s3-m5stack-sticks3/sdkconfig.defaults +130 -0
  271. package/targets/esp32-s3-touch-amoled-1.75/CMakeLists.txt +10 -0
  272. package/targets/esp32-s3-touch-amoled-1.75/dependencies.lock +130 -0
  273. package/targets/esp32-s3-touch-amoled-1.75/main/CMakeLists.txt +589 -0
  274. package/targets/esp32-s3-touch-amoled-1.75/main/Kconfig.projbuild +12 -0
  275. package/targets/esp32-s3-touch-amoled-1.75/main/app_main.cpp +153 -0
  276. package/targets/esp32-s3-touch-amoled-1.75/main/i2c.cpp +39 -0
  277. package/targets/esp32-s3-touch-amoled-1.75/main/idf_component.yml +9 -0
  278. package/targets/esp32-s3-touch-amoled-1.75/main/include/board.h +110 -0
  279. package/targets/esp32-s3-touch-amoled-1.75/main/include/wifi_config.h.example +5 -0
  280. package/targets/esp32-s3-touch-amoled-1.75/main/launcher_button.cpp +191 -0
  281. package/targets/esp32-s3-touch-amoled-1.75/main/touch.cpp +45 -0
  282. package/targets/esp32-s3-touch-amoled-1.75/partitions.csv +8 -0
  283. package/targets/esp32-s3-touch-amoled-1.75/sdkconfig.defaults +179 -0
  284. package/targets/esp32-s3-touch-amoled-1.8/CMakeLists.txt +10 -0
  285. package/targets/esp32-s3-touch-amoled-1.8/dependencies.lock +105 -0
  286. package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +768 -0
  287. package/targets/esp32-s3-touch-amoled-1.8/main/Kconfig.projbuild +12 -0
  288. package/targets/esp32-s3-touch-amoled-1.8/main/app_main.cpp +172 -0
  289. package/targets/esp32-s3-touch-amoled-1.8/main/i2c.cpp +39 -0
  290. package/targets/esp32-s3-touch-amoled-1.8/main/idf_component.yml +8 -0
  291. package/targets/esp32-s3-touch-amoled-1.8/main/include/board.h +83 -0
  292. package/targets/esp32-s3-touch-amoled-1.8/main/include/wifi_config.h.example +5 -0
  293. package/targets/esp32-s3-touch-amoled-1.8/main/launcher_button.cpp +191 -0
  294. package/targets/esp32-s3-touch-amoled-1.8/main/touch.cpp +41 -0
  295. package/targets/esp32-s3-touch-amoled-1.8/partitions.csv +8 -0
  296. package/targets/esp32-s3-touch-amoled-1.8/sdkconfig.defaults +179 -0
  297. package/targets/esp32-s3-touch-amoled-2.06/CMakeLists.txt +10 -0
  298. package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +64 -0
  299. package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +1121 -0
  300. package/targets/esp32-s3-touch-amoled-2.06/main/Kconfig.projbuild +12 -0
  301. package/targets/esp32-s3-touch-amoled-2.06/main/app_main.cpp +333 -0
  302. package/targets/esp32-s3-touch-amoled-2.06/main/i2c.cpp +39 -0
  303. package/targets/esp32-s3-touch-amoled-2.06/main/idf_component.yml +27 -0
  304. package/targets/esp32-s3-touch-amoled-2.06/main/include/board.h +114 -0
  305. package/targets/esp32-s3-touch-amoled-2.06/main/include/wifi_config.h.example +5 -0
  306. package/targets/esp32-s3-touch-amoled-2.06/main/launcher_button.cpp +199 -0
  307. package/targets/esp32-s3-touch-amoled-2.06/main/sdcard_mount.cpp +105 -0
  308. package/targets/esp32-s3-touch-amoled-2.06/main/touch.cpp +49 -0
  309. package/targets/esp32-s3-touch-amoled-2.06/partitions.csv +14 -0
  310. package/targets/esp32-s3-touch-amoled-2.06/sdkconfig.defaults +273 -0
  311. package/targets/esp32-s3-touch-amoled-2.41/CMakeLists.txt +10 -0
  312. package/targets/esp32-s3-touch-amoled-2.41/main/CMakeLists.txt +71 -0
  313. package/targets/esp32-s3-touch-amoled-2.41/main/Kconfig.projbuild +12 -0
  314. package/targets/esp32-s3-touch-amoled-2.41/main/idf_component.yml +27 -0
  315. package/targets/esp32-s3-touch-amoled-2.41/main/include/board.h +108 -0
  316. package/targets/esp32-s3-touch-amoled-2.41/main/include/wifi_config.h.example +5 -0
  317. package/targets/esp32-s3-touch-amoled-2.41/main/panel_reset.cpp +82 -0
  318. package/targets/esp32-s3-touch-amoled-2.41/main/touch.cpp +49 -0
  319. package/targets/esp32-s3-touch-amoled-2.41/partitions.csv +8 -0
  320. package/targets/esp32-s3-touch-amoled-2.41/sdkconfig.defaults +273 -0
  321. package/targets/rp2350-tufty-2350/CMakeLists.txt +348 -0
  322. package/targets/rp2350-tufty-2350/README.md +53 -0
  323. package/targets/rp2350-tufty-2350/boards/pimoroni_tufty2350.h +87 -0
  324. package/targets/rp2350-tufty-2350/main/bringup.cpp +187 -0
  325. package/targets/rp2350-tufty-2350/main/include/board.h +124 -0
  326. package/targets/rp2350-tufty-2350/main/rp2350_panel.cpp +428 -0
  327. package/targets/rp2350-tufty-2350/main/rp2350_panel.h +46 -0
  328. package/targets/rp2350-tufty-2350/main/st7789_parallel.pio +7 -0
  329. package/targets/rp2350-waveshare-touch-amoled-2.41/CMakeLists.txt +345 -0
  330. package/targets/rp2350-waveshare-touch-amoled-2.41/README.md +153 -0
  331. package/targets/rp2350-waveshare-touch-amoled-2.41/boards/waveshare_rp2350_touch_amoled_2_41.h +59 -0
  332. package/targets/rp2350-waveshare-touch-amoled-2.41/main/app.cpp +984 -0
  333. package/targets/rp2350-waveshare-touch-amoled-2.41/main/bringup.cpp +222 -0
  334. package/targets/rp2350-waveshare-touch-amoled-2.41/main/include/board.h +138 -0
  335. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.cpp +2553 -0
  336. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_gea_platform.h +18 -0
  337. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_host_fetch_stub.cpp +64 -0
  338. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.cpp +677 -0
  339. package/targets/rp2350-waveshare-touch-amoled-2.41/main/rp2350_panel.h +48 -0
  340. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.c +354 -0
  341. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/rp_pico_alloc.h +56 -0
  342. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.c +1284 -0
  343. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf.h +95 -0
  344. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_block_functions.h +123 -0
  345. package/targets/rp2350-waveshare-touch-amoled-2.41/main/vendor/waveshare_psram/tlsf/tlsf_common.h +127 -0
  346. package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-bench.py +162 -0
  347. package/targets/rp2350-waveshare-touch-amoled-2.41/tools/rp2350-scroll-parity.py +198 -0
  348. package/targets.json +154 -0
@@ -0,0 +1,1121 @@
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
+ set(GEA_CUSTOM_TARGET_ACTIVE 0)
11
+ if(GEA_BOARD_DEFINITION)
12
+ # board.h and target.cmake for a custom board are generated by the gea CLI
13
+ # (gea build --board <alias>) into the build directory before configure.
14
+ if(NOT GEA_CUSTOM_TARGET_DIR AND DEFINED ENV{GEA_CUSTOM_TARGET_DIR})
15
+ set(GEA_CUSTOM_TARGET_DIR "$ENV{GEA_CUSTOM_TARGET_DIR}")
16
+ endif()
17
+ if(NOT GEA_CUSTOM_TARGET_DIR)
18
+ set(GEA_CUSTOM_TARGET_DIR "${CMAKE_BINARY_DIR}/gea-custom-target")
19
+ endif()
20
+ if(NOT EXISTS "${GEA_CUSTOM_TARGET_DIR}/target.cmake")
21
+ message(FATAL_ERROR "Custom board files were not generated at ${GEA_CUSTOM_TARGET_DIR}. Run this target through the gea CLI (gea build --board <alias>).")
22
+ endif()
23
+ include("${GEA_CUSTOM_TARGET_DIR}/target.cmake")
24
+ message(STATUS "Custom board: ${GEA_BOARD_DEFINITION}")
25
+ endif()
26
+
27
+ # GEA_EMBEDDED_APP must be set explicitly in the real configure pass — no
28
+ # default. The build script `scripts/board` passes
29
+ # `-DGEA_EMBEDDED_APP=<id>` for every command, so this is invisible in
30
+ # normal use. Without an explicit value the previous default `tic-tac-toe`
31
+ # silently picked an arbitrary app whose features didn't match the user's
32
+ # actual selection, producing a REQUIRES list mismatched against the real
33
+ # pass.
34
+ #
35
+ # Script-mode (`cmake -P`, used by IDF's component_get_requirements.cmake)
36
+ # is a special case: it runs before the user's -D args reach the cache, so
37
+ # a hard error there would break component-requirement extraction
38
+ # entirely. We fall through to `tilt-breakout` in that pass because it is a
39
+ # gea app with a broad native binding surface.
40
+ set(GEA_EMBEDDED_APP "" CACHE STRING "Example app to build (must match a package.json gea.id) — required, no default")
41
+ if(CMAKE_SCRIPT_MODE_FILE AND "${GEA_EMBEDDED_APP}" STREQUAL "")
42
+ set(GEA_EMBEDDED_APP "tilt-breakout")
43
+ elseif(NOT CMAKE_SCRIPT_MODE_FILE AND "${GEA_EMBEDDED_APP}" STREQUAL "")
44
+ 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).")
45
+ endif()
46
+
47
+ set(GEA_EMBEDDED_HTTPS_SUPPORT "auto" CACHE STRING "Enable HTTPS fetch support: auto, on, or off")
48
+ set(GEA_EMBEDDED_CPP_BOARD "esp32-s3-touch-amoled-2.06" CACHE STRING "Board profile passed to geatsc for C++ target selection")
49
+ set(GEA_EMBEDDED_CSS_DEVICE_PIXEL_RATIO "1.5" CACHE STRING "Logical CSS px to physical pixel scale for this board")
50
+
51
+ # Write a file only when its content would change. Preserves mtime when content matches,
52
+ # so downstream make/ninja rules don't see spurious changes on every reconfigure.
53
+ function(_gea_write_if_different FILE_PATH CONTENT)
54
+ set(_should_write 1)
55
+ if(EXISTS "${FILE_PATH}")
56
+ file(READ "${FILE_PATH}" _existing)
57
+ if("${_existing}" STREQUAL "${CONTENT}")
58
+ set(_should_write 0)
59
+ endif()
60
+ endif()
61
+ if(_should_write)
62
+ file(WRITE "${FILE_PATH}" "${CONTENT}")
63
+ endif()
64
+ endfunction()
65
+
66
+ # Enumerate files under DIR matching one of the source extensions / config filenames, pruning
67
+ # node_modules / dist / .vite / generated-output at directory boundaries. CMake's
68
+ # file(GLOB_RECURSE) walks every file in the tree before filtering — for example dirs that's
69
+ # ~1000 stat calls per node_modules. find(1) prunes at the directory level, so configure stays
70
+ # under a second instead of half a minute. generated-output is geatsc's own test-verification
71
+ # scratch tree (tsc-verify/test262 fixtures) — not compiler source, but matched extensions
72
+ # (.ts/.js) and pathological filenames from Windows-path test cases (literal backslashes) can
73
+ # reach CMake's dependency list and corrupt it (invalid escape sequence in the generated
74
+ # Makefile). Pruning it here keeps this scan scoped to real compiler/plugin/core source, exactly
75
+ # like dist/build are already excluded as build output rather than source. `.build` is the
76
+ # geatsc test-runner scratch tree (core/packages/core/test/.build/*) whose transient .js
77
+ # fixtures otherwise land in the stamp's DEPENDS and break the build once the tests clean them
78
+ # up ("No rule to make target ...button-tetris-drop-driver.js").
79
+ function(_gea_find_sources OUT_VAR DIR)
80
+ get_filename_component(_gea_find_dir "${DIR}" REALPATH)
81
+ set(_gea_optional_prunes "")
82
+ if(ARGC GREATER 2 AND "${ARGV2}" STREQUAL "PRUNE_VENDOR")
83
+ list(APPEND _gea_optional_prunes -o -name vendor)
84
+ endif()
85
+ execute_process(
86
+ COMMAND find -L "${_gea_find_dir}"
87
+ -type d \( -name node_modules -o -name dist -o -name .vite -o -name build -o -name .build -o -name .scratch -o -name .test-tmp -o -name generated-output ${_gea_optional_prunes} \) -prune
88
+ -o -type f \(
89
+ -name "*.tsx" -o -name "*.ts" -o -name "*.jsx" -o -name "*.js"
90
+ -o -name "*.css" -o -name "*.html"
91
+ -o -name "package.json" -o -name "tsconfig.json" -o -name "vite.config.ts"
92
+ \) -print
93
+ OUTPUT_VARIABLE _output
94
+ OUTPUT_STRIP_TRAILING_WHITESPACE
95
+ )
96
+ if(_output STREQUAL "")
97
+ set(${OUT_VAR} "" PARENT_SCOPE)
98
+ else()
99
+ string(REPLACE "\n" ";" _list "${_output}")
100
+ set(${OUT_VAR} "${_list}" PARENT_SCOPE)
101
+ endif()
102
+ endfunction()
103
+
104
+ function(_gea_collect_app_sources OUT_VAR APP_DIR)
105
+ _gea_find_sources(_src "${APP_DIR}")
106
+ set(${OUT_VAR} "${_src}" PARENT_SCOPE)
107
+ endfunction()
108
+
109
+ # App image assets (PNG/JPG/GIF). generate-gea-embedded-assets.mjs embeds these as
110
+ # .rodata referenced by `<img src>`, so they MUST be on the geatsc_build DEPENDS
111
+ # list: otherwise resizing/replacing an image never re-runs codegen and the stale
112
+ # bytes ship (and an oversized PNG silently fails to decode on-device). Scoped to
113
+ # the app dir (not the framework) so configure stays fast.
114
+ function(_gea_collect_app_assets OUT_VAR APP_DIR)
115
+ execute_process(
116
+ COMMAND find -L "${APP_DIR}"
117
+ -type d \( -name node_modules -o -name dist -o -name .vite -o -name build -o -name .build \) -prune
118
+ -o -type f \(
119
+ -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.gif"
120
+ \) -print
121
+ OUTPUT_VARIABLE _output
122
+ OUTPUT_STRIP_TRAILING_WHITESPACE
123
+ )
124
+ if(_output STREQUAL "")
125
+ set(${OUT_VAR} "" PARENT_SCOPE)
126
+ else()
127
+ string(REPLACE "\n" ";" _list "${_output}")
128
+ set(${OUT_VAR} "${_list}" PARENT_SCOPE)
129
+ endif()
130
+ endfunction()
131
+
132
+ # Source files that affect Gea compiler -> geatsc output. Keep this scoped to
133
+ # the embedded framework, upstream Gea compiler, and @geatsc/plugin-gea.
134
+ _gea_find_sources(_GEA_COMPILER_DEP_SRCS "${GEA_CORE}/..")
135
+ _gea_find_sources(_GEA_UPSTREAM_GEA_SRCS "${GEA_COMPILER}" PRUNE_VENDOR)
136
+ _gea_find_sources(_GEATSC_GEA_PLUGIN_SRCS "${GEA_PLUGIN}")
137
+ if(CMAKE_SCRIPT_MODE_FILE)
138
+ file(GLOB_RECURSE _GEATSC_GEA_PLUGIN_DIST_SRCS
139
+ "${GEA_PLUGIN}/dist/*.js"
140
+ "${GEA_PLUGIN}/dist/*.json"
141
+ )
142
+ else()
143
+ file(GLOB_RECURSE _GEATSC_GEA_PLUGIN_DIST_SRCS CONFIGURE_DEPENDS
144
+ "${GEA_PLUGIN}/dist/*.js"
145
+ "${GEA_PLUGIN}/dist/*.json"
146
+ )
147
+ endif()
148
+ list(APPEND _GEA_COMPILER_DEP_SRCS
149
+ "${GEA_CORE}/scripts/build-gea-vite-geatsc.mjs"
150
+ "${GEA_CORE}/scripts/gea-embedded-compat-transform.mjs"
151
+ "${GEA_CORE}/scripts/generate-gea-embedded-fonts.mjs"
152
+ ${_GEA_UPSTREAM_GEA_SRCS}
153
+ ${_GEATSC_GEA_PLUGIN_SRCS}
154
+ ${_GEATSC_GEA_PLUGIN_DIST_SRCS}
155
+ )
156
+ list(REMOVE_DUPLICATES _GEA_COMPILER_DEP_SRCS)
157
+ get_property(_GEA_CONFIGURE_DEPS_REGISTERED GLOBAL PROPERTY GEA_CONFIGURE_DEPS_REGISTERED)
158
+ if(NOT CMAKE_SCRIPT_MODE_FILE AND _GEA_COMPILER_DEP_SRCS AND NOT _GEA_CONFIGURE_DEPS_REGISTERED)
159
+ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${_GEA_COMPILER_DEP_SRCS})
160
+ set_property(GLOBAL PROPERTY GEA_CONFIGURE_DEPS_REGISTERED TRUE)
161
+ endif()
162
+
163
+ # Platform-universal ESP32 host facades (single source of truth).
164
+ include("${GEA_EMBEDDED_ROOT}/targets/esp32/host_sources.cmake")
165
+
166
+ file(GLOB _GEA_FONT_ASSETS
167
+ "${GEA_EMBEDDED_ROOT}/assets/fonts/*.ttf"
168
+ "${GEA_EMBEDDED_ROOT}/assets/fonts/*.otf"
169
+ "${GEA_EMBEDDED_ROOT}/assets/fonts/*.woff"
170
+ "${GEA_EMBEDDED_ROOT}/assets/fonts/*.woff2"
171
+ )
172
+
173
+ # App metadata (root;entry;runtime;native sources...) is resolved once by the
174
+ # gea CLI and handed to gea_framework.cmake as GEA_EMBEDDED_APP_META; the
175
+ # GEA_EMBEDDED_APP_DIR/ENTRY/RUNTIME/NATIVE_SOURCE_RELS variables come from there.
176
+
177
+ set(GEA_EMBEDDED_APP_NATIVE_SOURCES "")
178
+ # Expose each app-owned native source's dir (plus the app's `native/` dir) on the
179
+ # include path so the generated program's host-binding includes — e.g.
180
+ # "native_bench.h" emitted for `gea::host::native_bench` — resolve. Mirrors the
181
+ # rp2350 target (rp2350-tufty-2350/CMakeLists.txt).
182
+ set(GEA_EMBEDDED_APP_NATIVE_INCLUDE_DIRS "")
183
+ foreach(_GEA_EMBEDDED_APP_NATIVE_SOURCE_REL IN LISTS GEA_EMBEDDED_APP_NATIVE_SOURCE_RELS)
184
+ list(APPEND GEA_EMBEDDED_APP_NATIVE_SOURCES "${GEA_EMBEDDED_APP_DIR}/${_GEA_EMBEDDED_APP_NATIVE_SOURCE_REL}")
185
+ get_filename_component(_GEA_EMBEDDED_APP_NATIVE_SOURCE_DIR "${GEA_EMBEDDED_APP_DIR}/${_GEA_EMBEDDED_APP_NATIVE_SOURCE_REL}" DIRECTORY)
186
+ list(APPEND GEA_EMBEDDED_APP_NATIVE_INCLUDE_DIRS "${_GEA_EMBEDDED_APP_NATIVE_SOURCE_DIR}")
187
+ endforeach()
188
+ if(GEA_EMBEDDED_APP_NATIVE_SOURCES)
189
+ # Apps may keep native sources anywhere (e.g. vendored under src/); only
190
+ # add the conventional native/ dir when it actually exists — ESP-IDF
191
+ # rejects nonexistent include dirs.
192
+ if(IS_DIRECTORY "${GEA_EMBEDDED_APP_DIR}/native")
193
+ list(APPEND GEA_EMBEDDED_APP_NATIVE_INCLUDE_DIRS "${GEA_EMBEDDED_APP_DIR}/native")
194
+ endif()
195
+ list(REMOVE_DUPLICATES GEA_EMBEDDED_APP_NATIVE_INCLUDE_DIRS)
196
+ endif()
197
+
198
+ set(JS_APP_SRC "${GEA_EMBEDDED_APP_DIR}/${GEA_EMBEDDED_APP_ENTRY}")
199
+
200
+ # Each application's generated output gets its own build directory.
201
+ set(GENERATED_APP_DIR "${CMAKE_BINARY_DIR}/apps/${GEA_EMBEDDED_APP}")
202
+ file(MAKE_DIRECTORY "${GENERATED_APP_DIR}")
203
+ set(JS_APP "${GENERATED_APP_DIR}/dist/index.js")
204
+ # geatsc emits one C++ translation unit per source module and records the
205
+ # compile set in geatsc-sources.txt. A generated archive consumes that list at
206
+ # build time so CMake configure does not need to know module filenames up front.
207
+ set(GEATSC_SOURCE_LIST "${GENERATED_APP_DIR}/geatsc-sources.txt")
208
+ set(GEATSC_ARCHIVE "${GENERATED_APP_DIR}/libgea_active_geatsc.a")
209
+ set(GENERATED_FONT_CPP "${GENERATED_APP_DIR}/gea_embedded_font_generated.cpp")
210
+ set(GENERATED_FONT_H "${GENERATED_APP_DIR}/gea_embedded_font_generated.h")
211
+ set(GENERATED_ASSETS_CPP "${GENERATED_APP_DIR}/gea_embedded_assets_generated.cpp")
212
+ set(GENERATED_CONFIG_H "${GENERATED_APP_DIR}/gea_embedded_app_config.h")
213
+ set(GENERATED_INSTALLED_APPS_H "${CMAKE_BINARY_DIR}/gea_embedded_installed_apps_generated.h")
214
+ execute_process(
215
+ COMMAND node
216
+ "${GEA_CORE}/scripts/generate-installed-app-plan.mjs"
217
+ "${CMAKE_CURRENT_LIST_DIR}/../partitions.csv"
218
+ "${GENERATED_INSTALLED_APPS_H}"
219
+ RESULT_VARIABLE GEA_EMBEDDED_INSTALLED_APPS_RESULT
220
+ )
221
+ if(NOT GEA_EMBEDDED_INSTALLED_APPS_RESULT EQUAL 0)
222
+ message(FATAL_ERROR "Failed to generate installed app plan from partitions.csv")
223
+ endif()
224
+
225
+ # The app source owns app-level defaults. On a fresh configure, create only a minimal
226
+ # placeholder; the unified geatsc path can overwrite it with app-derived config
227
+ # later if a native define surface lands here.
228
+ if(NOT EXISTS "${GENERATED_CONFIG_H}")
229
+ # Stub config header kept around because app_main.cpp still includes it.
230
+ _gea_write_if_different("${GENERATED_CONFIG_H}" "#pragma once\n")
231
+ endif()
232
+ if(NOT EXISTS "${GENERATED_FONT_H}")
233
+ _gea_write_if_different("${GENERATED_FONT_H}" [[
234
+ #pragma once
235
+ #define GEA_EMBEDDED_HAS_GENERATED_FONTS 1
236
+ #include "graphics/font.h"
237
+ #define GEA_EMBEDDED_FONT_COUNT 0
238
+ #define GEA_EMBEDDED_FONT_FAMILY_COUNT 0
239
+ ]])
240
+ endif()
241
+ if(NOT EXISTS "${GENERATED_FONT_CPP}")
242
+ _gea_write_if_different("${GENERATED_FONT_CPP}" [[
243
+ #include "gea_embedded_font_generated.h"
244
+ namespace gea::framework::graphics::generated {
245
+ void ensureLinked() {}
246
+ const RasterizedFontData *lookupFont(int fontId)
247
+ {
248
+ (void)fontId;
249
+ return nullptr;
250
+ }
251
+ const RasterizedFontData *lookupFontForFamily(int familyId, int sizePx)
252
+ {
253
+ (void)familyId;
254
+ (void)sizePx;
255
+ return nullptr;
256
+ }
257
+ int lookupFontFamily(const char *family)
258
+ {
259
+ (void)family;
260
+ return -1;
261
+ }
262
+ } // namespace gea::framework::graphics::generated
263
+ ]])
264
+ endif()
265
+ # Stub asset TU on the SRCS list before geatsc_build overwrites it with the
266
+ # real (or empty) generated registry. Mirrors the font stub above.
267
+ if(NOT EXISTS "${GENERATED_ASSETS_CPP}")
268
+ _gea_write_if_different("${GENERATED_ASSETS_CPP}" [[
269
+ // No embedded assets (stub overwritten by generate-gea-embedded-assets.mjs).
270
+ ]])
271
+ endif()
272
+
273
+ # geatsc mode: generated app/user code is compiled from geatsc-sources.txt
274
+ # into a separate archive, then linked with the firmware-side Gea adapter and host bindings.
275
+ # Without app metadata (a configure driven by hand, or IDF's script-mode
276
+ # requirements pass before the CLI's -D values land) JS_APP_SRC is a bare
277
+ # directory; analyzing it would crash node with EISDIR and abort the
278
+ # configure with a misleading "has geatsc been built?" error. The normal
279
+ # pass refuses with the real reason; script mode carries on with an empty
280
+ # binding set, since that pass only extracts component requirements.
281
+ if(NOT EXISTS "${JS_APP_SRC}" OR IS_DIRECTORY "${JS_APP_SRC}")
282
+ if(NOT CMAKE_SCRIPT_MODE_FILE)
283
+ 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>")
284
+ endif()
285
+ set(_GEA_EMBEDDED_ANALYZE_RAW "bindings=\nfeatures=")
286
+ set(_GEA_EMBEDDED_ANALYZE_STATUS 0)
287
+ else()
288
+ execute_process(
289
+ COMMAND node
290
+ "${GEA_COMPILER}/dist/cli.js"
291
+ analyze
292
+ "${JS_APP_SRC}"
293
+ --plugin
294
+ "${GEA_PLUGIN}/dist/index.js"
295
+ OUTPUT_VARIABLE _GEA_EMBEDDED_ANALYZE_RAW
296
+ OUTPUT_STRIP_TRAILING_WHITESPACE
297
+ RESULT_VARIABLE _GEA_EMBEDDED_ANALYZE_STATUS
298
+ )
299
+ endif()
300
+ if(NOT _GEA_EMBEDDED_ANALYZE_STATUS EQUAL 0)
301
+ message(FATAL_ERROR "geatsc analyze failed for app '${GEA_EMBEDDED_APP}' — has packages/geatsc been built? (run `npm --prefix packages/geatsc run build`)")
302
+ endif()
303
+ # `geatsc analyze` outputs two lines: `bindings=<ids>` and `features=<ids>`.
304
+ string(REGEX MATCH "bindings=([^\n]*)" _ "${_GEA_EMBEDDED_ANALYZE_RAW}")
305
+ set(_GEA_EMBEDDED_HOST_BINDINGS "${CMAKE_MATCH_1}")
306
+ list(REMOVE_DUPLICATES _GEA_EMBEDDED_HOST_BINDINGS)
307
+ if("${_GEA_EMBEDDED_HOST_BINDINGS}" MATCHES "(^|;)screen($|;)")
308
+ message(FATAL_ERROR "The gea screen host binding was removed; generated apps must target the embedded UI/canvas framework")
309
+ endif()
310
+ string(REGEX MATCH "features=([^\n]*)" _ "${_GEA_EMBEDDED_ANALYZE_RAW}")
311
+ set(_GEA_EMBEDDED_HOST_FEATURES "${CMAKE_MATCH_1}")
312
+
313
+ # NOTE: ${GENERATED_ASSETS_CPP} is deliberately NOT in this list (i.e. not a main
314
+ # component source). Its symbols are `extern "C" __attribute__((weak))` const arrays,
315
+ # and the app code that references them now lives in the separate libgea_active_geatsc.a
316
+ # archive. A weak-only definition inside an archive member never triggers extraction to
317
+ # satisfy a cross-archive reference, so the assets would link out and leave undefined
318
+ # references (gea_asset_*_png). Instead it is built into its own static lib that is linked
319
+ # with --whole-archive below, forcing the arrays in regardless of the weak attribute
320
+ # (which is still needed to deduplicate shared assets).
321
+ set(APP_GENERATED_SOURCES
322
+ ${GEA_EMBEDDED_APP_NATIVE_SOURCES}
323
+ "${GEA_APP_ENTRY_SRC}"
324
+ ${GENERATED_FONT_CPP}
325
+ )
326
+ set(GEATSC_COMPILE_OPTIONS
327
+ -Wno-unused-variable
328
+ -Wno-return-type
329
+ -Wno-format-truncation
330
+ # Generated destructuring emits an empty shared_ptr fallback branch that is
331
+ # dead for required fields. Only this board compiles geatsc at -O2, and the
332
+ # extra inlining lets gcc 15 trace that branch into a member push_back and
333
+ # report a bogus "subscript 0 is outside array bounds" on the null object.
334
+ -Wno-array-bounds
335
+ # Chained property readers lower to nested decltype(auto) helpers where an
336
+ # inner reader's missing-value branch returns a fresh temporary while its
337
+ # present-value branch returns a reference into the (persistent) store data.
338
+ # gcc 13+ -Wdangling-reference then flags the outer `auto&&` binding as
339
+ # possibly dangling. It only dangles on the missing-value path, which the
340
+ # weather store never takes (the fetched payload always carries the field),
341
+ # and the warning is a well-known false-positive generator for exactly this
342
+ # decltype(auto)-chain shape. Suppress here like -Wno-array-bounds above.
343
+ -Wno-dangling-reference
344
+ # Same reader chain, GCC's other dangling diagnostic: inlining .size() on the
345
+ # `auto&&` binding of a reader whose missing-value branch returns a temporary
346
+ # std::vector makes gcc 15 read it as a dangling pointer into that temporary's
347
+ # storage. Same never-taken branch, same false positive.
348
+ -Wno-dangling-pointer
349
+ # And its third face: gcc 15 computes .size() (_M_finish - _M_start) on that
350
+ # same missing-branch temporary vector and calls the members uninitialized.
351
+ # Scoped to the generated GEATSC archive only (this block never applies to
352
+ # framework or app source), so hand-written uninitialized bugs still error.
353
+ -Wno-uninitialized
354
+ -O2
355
+ -mtext-section-literals
356
+ )
357
+ set(GEATSC_COMPILE_DEFINITIONS "")
358
+ if(NOT CMAKE_SCRIPT_MODE_FILE)
359
+ set_source_files_properties(
360
+ "${GEA_HOST}/host/rtc_esp.cpp"
361
+ PROPERTIES COMPILE_OPTIONS "-Wno-unused-variable;-Os"
362
+ )
363
+ if(GEA_EMBEDDED_APP STREQUAL "canvas-3d" OR GEA_EMBEDDED_APP STREQUAL "sky-hop-jsx")
364
+ list(APPEND GEATSC_COMPILE_DEFINITIONS GEA_CPP_MINIMAL_GLOBAL_OBJECT=1)
365
+ endif()
366
+ if(GEA_EMBEDDED_APP STREQUAL "canvas-3d")
367
+ list(APPEND GEATSC_COMPILE_DEFINITIONS GEA_EMBEDDED_DIRECT_CANVAS_CONTEXT=1)
368
+ set_property(SOURCE
369
+ ${GEA_APP_ENTRY_SRC}
370
+ "${GEA_CORE}/runtime.cpp"
371
+ "${GEA_ENGINE}/ui/canvas_element.cpp"
372
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/services/frame_scheduler.cpp"
373
+ APPEND PROPERTY COMPILE_DEFINITIONS GEA_EMBEDDED_DIRECT_CANVAS_CONTEXT=1)
374
+ endif()
375
+ endif()
376
+ set(GEA_EMBEDDED_HTTPS_REQUIRES "")
377
+ set(GEA_EMBEDDED_HTTPS_COMPILE_DEFINITIONS "")
378
+ set(GEA_EMBEDDED_BLE_COMPILE_DEFINITIONS "")
379
+ set(GEA_EMBEDDED_CAPABILITY_COMPILE_DEFINITIONS "")
380
+
381
+ # IDF evaluates this component once in script mode with the broad placeholder
382
+ # app and again for the real configure. A normal variable from the requirements
383
+ # pass can therefore say BLE is enabled even when the selected app does not use
384
+ # it. Only an explicit -D cache value is an override; otherwise resolve the
385
+ # capability again from the real app analysis before choosing sources/REQUIRES.
386
+ if(DEFINED ENV{GEA_EMBEDDED_BLE_OTA} AND "$ENV{GEA_EMBEDDED_BLE_OTA}" STREQUAL "1")
387
+ set(GEA_EMBEDDED_CAPABILITY_BLE 1)
388
+ elseif(DEFINED ENV{GEA_EMBEDDED_CAPABILITY_BLE}
389
+ AND NOT "$ENV{GEA_EMBEDDED_CAPABILITY_BLE}" STREQUAL "")
390
+ set(GEA_EMBEDDED_CAPABILITY_BLE "$ENV{GEA_EMBEDDED_CAPABILITY_BLE}")
391
+ elseif(DEFINED CACHE{GEA_EMBEDDED_CAPABILITY_BLE}
392
+ AND NOT "$CACHE{GEA_EMBEDDED_CAPABILITY_BLE}" STREQUAL "")
393
+ set(GEA_EMBEDDED_CAPABILITY_BLE "$CACHE{GEA_EMBEDDED_CAPABILITY_BLE}")
394
+ else()
395
+ set(GEA_EMBEDDED_CAPABILITY_BLE 0)
396
+ if("${_GEA_EMBEDDED_HOST_BINDINGS}" MATCHES "(^|;)ble($|;)")
397
+ set(GEA_EMBEDDED_CAPABILITY_BLE 1)
398
+ endif()
399
+ endif()
400
+
401
+ # Network and audio resolve the same way as BLE above: an explicit value from
402
+ # the CLI (env, then the -D cache entry) wins, and a direct `idf.py` build falls
403
+ # back to what `geatsc analyze` saw the app import. A board target that linked
404
+ # the whole Wi-Fi/HTTP/TLS stack and the codec path into an app that asks for
405
+ # neither is not a smaller price for being invisible -- it is flash, RAM,
406
+ # link-time literal pressure, and managed components nobody asked for.
407
+ if(DEFINED ENV{GEA_EMBEDDED_CAPABILITY_NETWORK}
408
+ AND NOT "$ENV{GEA_EMBEDDED_CAPABILITY_NETWORK}" STREQUAL "")
409
+ set(GEA_EMBEDDED_CAPABILITY_NETWORK "$ENV{GEA_EMBEDDED_CAPABILITY_NETWORK}")
410
+ elseif(DEFINED CACHE{GEA_EMBEDDED_CAPABILITY_NETWORK}
411
+ AND NOT "$CACHE{GEA_EMBEDDED_CAPABILITY_NETWORK}" STREQUAL "")
412
+ set(GEA_EMBEDDED_CAPABILITY_NETWORK "$CACHE{GEA_EMBEDDED_CAPABILITY_NETWORK}")
413
+ else()
414
+ set(GEA_EMBEDDED_CAPABILITY_NETWORK 0)
415
+ if("${_GEA_EMBEDDED_HOST_BINDINGS}" MATCHES "(^|;)(wifi|fetch|http|websocket|rtc)($|;)"
416
+ OR "${_GEA_EMBEDDED_HOST_FEATURES}" MATCHES "(^|;)https($|;)")
417
+ set(GEA_EMBEDDED_CAPABILITY_NETWORK 1)
418
+ endif()
419
+ endif()
420
+ if(DEFINED ENV{GEA_EMBEDDED_CAPABILITY_AUDIO}
421
+ AND NOT "$ENV{GEA_EMBEDDED_CAPABILITY_AUDIO}" STREQUAL "")
422
+ set(GEA_EMBEDDED_CAPABILITY_AUDIO "$ENV{GEA_EMBEDDED_CAPABILITY_AUDIO}")
423
+ elseif(DEFINED CACHE{GEA_EMBEDDED_CAPABILITY_AUDIO}
424
+ AND NOT "$CACHE{GEA_EMBEDDED_CAPABILITY_AUDIO}" STREQUAL "")
425
+ set(GEA_EMBEDDED_CAPABILITY_AUDIO "$CACHE{GEA_EMBEDDED_CAPABILITY_AUDIO}")
426
+ else()
427
+ set(GEA_EMBEDDED_CAPABILITY_AUDIO 0)
428
+ if("${_GEA_EMBEDDED_HOST_BINDINGS}" MATCHES "(^|;)audio($|;)")
429
+ set(GEA_EMBEDDED_CAPABILITY_AUDIO 1)
430
+ endif()
431
+ endif()
432
+ message(STATUS "Gea app capabilities: network=${GEA_EMBEDDED_CAPABILITY_NETWORK} ble=${GEA_EMBEDDED_CAPABILITY_BLE} audio=${GEA_EMBEDDED_CAPABILITY_AUDIO}")
433
+
434
+ if(GEA_EMBEDDED_CAPABILITY_BLE)
435
+ list(APPEND GEA_EMBEDDED_BLE_COMPILE_DEFINITIONS GEA_EMBEDDED_APP_USES_BLE=1)
436
+ endif()
437
+ # One name for "this build compiles the BLE OTA path", so the source lists below
438
+ # gate on the same condition that defines the macro ble_hid.cpp compiles under.
439
+ set(GEA_EMBEDDED_BLE_OTA_ENABLED 0)
440
+ if(DEFINED ENV{GEA_EMBEDDED_BLE_OTA} AND "$ENV{GEA_EMBEDDED_BLE_OTA}" STREQUAL "1")
441
+ set(GEA_EMBEDDED_BLE_OTA_ENABLED 1)
442
+ list(APPEND GEA_EMBEDDED_BLE_COMPILE_DEFINITIONS GEA_EMBEDDED_BLE_OTA=1)
443
+ endif()
444
+ # Note: BLE driver registration + BLE controller preinit are forced from
445
+ # `app_main.cpp` and `bluetooth_service.cpp` regardless of the macro above,
446
+ # because `geatsc analyze` misses BLE usage routed through the internal
447
+ # `runtime-surface` re-export (as `gea-embedded`'s Settings panel does).
448
+ # The macro is kept narrow because `app_runner.cpp` uses it to decide
449
+ # whether `gea_init` is allocated in SPIRAM (when undefined) or internal
450
+ # DRAM (when defined). With 64 KB gea_init stack, forcing internal DRAM
451
+ # fails — only 32 KB largest contiguous block remains after wifi/diag init.
452
+ # `_GEA_EMBEDDED_HOST_FEATURES` is populated by `geatsc analyze` for the
453
+ # application.
454
+ #
455
+ # The user-facing `GEA_EMBEDDED_HTTPS_SUPPORT` cache option lets the build
456
+ # override auto-detection: `on` forces HTTPS linkage even when no
457
+ # `https://` URL appears in source, `off` skips it even when one does.
458
+ # `auto` (default) trusts analyze's verdict.
459
+ string(TOLOWER "${GEA_EMBEDDED_HTTPS_SUPPORT}" _GEA_EMBEDDED_HTTPS_SUPPORT_MODE)
460
+ set(_GEA_EMBEDDED_ENABLE_HTTPS 0)
461
+ if(_GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "auto")
462
+ if("${_GEA_EMBEDDED_HOST_FEATURES}" MATCHES "(^|;)https($|;)")
463
+ set(_GEA_EMBEDDED_ENABLE_HTTPS 1)
464
+ endif()
465
+ elseif(_GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "on"
466
+ OR _GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "true"
467
+ OR _GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "yes"
468
+ OR _GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "1")
469
+ set(_GEA_EMBEDDED_ENABLE_HTTPS 1)
470
+ elseif(_GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "off"
471
+ OR _GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "false"
472
+ OR _GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "no"
473
+ OR _GEA_EMBEDDED_HTTPS_SUPPORT_MODE STREQUAL "0")
474
+ set(_GEA_EMBEDDED_ENABLE_HTTPS 0)
475
+ else()
476
+ message(FATAL_ERROR "GEA_EMBEDDED_HTTPS_SUPPORT must be auto, on, or off")
477
+ endif()
478
+
479
+ if(_GEA_EMBEDDED_ENABLE_HTTPS AND GEA_EMBEDDED_CAPABILITY_NETWORK)
480
+ list(APPEND GEA_EMBEDDED_HTTPS_COMPILE_DEFINITIONS GEA_EMBEDDED_ENABLE_HTTPS=1)
481
+ # `mbedtls` lands in REQUIRES iff the active app actually needs HTTPS.
482
+ # The historical reason for unconditionally listing it (script-mode
483
+ # discrepancy with `GEA_EMBEDDED_APP=tic-tac-toe`) is gone now that
484
+ # script-mode falls through to a feature-rich gea placeholder. The
485
+ # condition here is the actual signal: an app with no https:// in source
486
+ # genuinely doesn't need mbedtls, and `--gc-sections` would strip it
487
+ # anyway.
488
+ list(APPEND GEA_EMBEDDED_HTTPS_REQUIRES mbedtls)
489
+ endif()
490
+
491
+ set(GEA_EMBEDDED_DIRECT_CANVAS_PROFILE 0)
492
+ if(GEA_EMBEDDED_APP STREQUAL "canvas-3d" OR GEA_EMBEDDED_APP STREQUAL "gea3d-cube")
493
+ set(GEA_EMBEDDED_DIRECT_CANVAS_PROFILE 1)
494
+ endif()
495
+ # The profile controls two independent things that only canvas-3d wants
496
+ # together: (a) the lean board build (minimal framework sources, radios off,
497
+ # boot services off, flush pool) and (b) the SLIM direct-canvas geatsc
498
+ # emission (direct_canvas_runtime.h — no gea_cpp_value dynamic machinery).
499
+ # gea3d-cube needs (a) but its class-heavy emitted code requires the full
500
+ # runtime, so its codegen stays on the standard emission.
501
+ set(GEA_EMBEDDED_DIRECT_CANVAS_CODEGEN ${GEA_EMBEDDED_DIRECT_CANVAS_PROFILE})
502
+ if(GEA_EMBEDDED_APP STREQUAL "gea3d-cube")
503
+ set(GEA_EMBEDDED_DIRECT_CANVAS_CODEGEN 0)
504
+ endif()
505
+
506
+ # f32 `number` storage WITHOUT the slim direct-canvas runtime: the S3 FPU is
507
+ # single-precision, so full-runtime DOM apps that opt in here keep the whole
508
+ # gea_cpp_value/DOM machinery but lower `number` to gea_f32 (and Math.* to the
509
+ # f32 helpers). Independent of the direct-canvas profile above.
510
+ set(GEA_EMBEDDED_NUMBER_F32 0)
511
+ if(GEA_EMBEDDED_APP STREQUAL "bouncing-balls-jsx" OR GEA_EMBEDDED_APP STREQUAL "bubble-grid")
512
+ set(GEA_EMBEDDED_NUMBER_F32 1)
513
+ endif()
514
+ # bubble-grid was MEASURED on f32 and is a REGRESSION — do not re-enable
515
+ # without re-measuring. f32 did what it says (fn_computeFisheye's soft-float
516
+ # helper calls dropped 48 -> 13, sqrt -> sqrtf), yet the draw loop went
517
+ # 6.57ms -> 8.3ms/frame. The per-circle SDF was never the dominant cost; the
518
+ # remaining float<->int64 conversion calls (__fixsfdi/__floatdisf) at the
519
+ # Int32Array/Uint16Array batching boundary cost more than the double math
520
+ # saved.
521
+
522
+ # FUSE_REPLAY_FLUSH: bouncing-balls-jsx (DOM, full-screen-dirty every frame) skips
523
+ # the separate replay-into-framebuffer pass AND the PSRAM->staging copy by fusing
524
+ # the replay into the flush — measured 30->47 fps. canvas-3d/gea3d-cube stay on the
525
+ # persistent-framebuffer path (0) that matches their 70-90fps historical numbers
526
+ # (see the FUSE=0 comparison-mode comment on the flag below).
527
+ set(GEA_EMBEDDED_FUSE_FLUSH_VALUE 0)
528
+ if(GEA_EMBEDDED_APP STREQUAL "bouncing-balls-jsx")
529
+ set(GEA_EMBEDDED_FUSE_FLUSH_VALUE 1)
530
+ endif()
531
+
532
+ # SUBTREE_REVEAL_CHECK (default 1): b300e2d added a per-node, per-frame call to
533
+ # DisplayList::subtreeRevealsUnrecordedContent — an O(nodeCount) whole-tree scan — in the
534
+ # keep-display-list guard, to reveal content that was culled outside the record-time clip
535
+ # and later pans INTO view (sky-hop). Apps whose content never leaves the viewport can't
536
+ # reveal anything, so for 64 translating balls it is O(N^2) waste AND spuriously forces a
537
+ # full display-list record every frame (measured: dlist 1499->300us, 47->50fps). Opt those
538
+ # apps out. Keep it ON (1) for any app that pans/reveals off-clip content.
539
+ set(GEA_EMBEDDED_REVEAL_CHECK_VALUE 1)
540
+ if(GEA_EMBEDDED_APP STREQUAL "bouncing-balls-jsx")
541
+ set(GEA_EMBEDDED_REVEAL_CHECK_VALUE 0)
542
+ endif()
543
+
544
+ # Skip Left/Top inline-style recording for apps whose position comes only from a reactive
545
+ # keyed list (bouncing-balls-jsx re-applies every frame; the record self-corrects). ~384µs/frame.
546
+ set(GEA_EMBEDDED_SKIP_POSITION_RECORD_VALUE 0)
547
+ if(GEA_EMBEDDED_APP STREQUAL "bouncing-balls-jsx")
548
+ set(GEA_EMBEDDED_SKIP_POSITION_RECORD_VALUE 1)
549
+ endif()
550
+
551
+ # CS-held (non-draining) framebuffer stream: pipeline the fused-raster chunks via
552
+ # queueColorStreamData (raster chunk N+1 overlaps chunk N's DMA) exactly like the
553
+ # present path that gets non-jsx to 65fps — instead of the synchronous per-chunk
554
+ # txColor that drains the SPI queue every chunk. MEASURED 2026-07-08 net-neutral:
555
+ # CS-held at 36-row/14-chunk = 58.3fps vs draining 58.7 (noise). The fused flush is
556
+ # NOT drain-bound — pipelining doesn't help. The ~1.6ms gap vs non-jsx's present
557
+ # path (11.9ms/65fps) is the RASTER ROUTINE: jsx replays a full reactive display
558
+ # list (64 nodes: clip/style/layout) per chunk vs present's lean command list.
559
+ # Closing it needs a fused-raster→command-list rewrite, not drain-vs-CS-held.
560
+ # Left 0 (draining path proven); code kept in display.cpp gated off. Do not retry
561
+ # CS-held at other chunk sizes: 16-row = 47.5fps (per-chunk overhead x31 dominates).
562
+ # PROBE RESULT 2026-07-08: rasterSum~4350us / flushWall~11800us — fused raster is only
563
+ # 37% of the flush and FULLY HIDDEN under DMA slot-waits. Flush is WIRE-BOUND at ~34MB/s
564
+ # (=present's rate). The ~1.7ms/frame beginColorStream bus-acquire cancels CS-held's
565
+ # pipelining gain → net-neutral. Conclusion: a fused-raster→command-list rewrite buys
566
+ # NOTHING (raster already hidden), and both jsx & non-jsx share the same ~11.8ms full-
567
+ # screen wire floor. The jsx↔non-jsx fps gap is APP COMPUTE (reactive tree), not flush.
568
+ set(GEA_EMBEDDED_FB_CS_HELD_VALUE 1)
569
+
570
+ set(GEA_FW_CXX_SOURCES_FOR_APP ${GEA_FW_CXX_SOURCES})
571
+ set(GEA_FW_C_SOURCES_FOR_APP ${GEA_FW_C_SOURCES})
572
+ set(GEA_EMBEDDED_DIRECT_CANVAS_COMPILE_DEFINITIONS "")
573
+
574
+ set(GEA_EMBEDDED_BOARD_SOURCES "app_main.cpp")
575
+ if(GEA_CUSTOM_TARGET_ACTIVE)
576
+ # display.cpp is the QSPI panel layer — framebuffer, chunked DMA flush, TE.
577
+ # A composed board with no `chips.display` has none of that to drive, so
578
+ # GEA_CUSTOM_TARGET_DISPLAY_SOURCES carries display_headless.cpp instead:
579
+ # the same canvas-backed Display, flushing to memory rather than a panel.
580
+ if(GEA_CUSTOM_TARGET_HAS_DISPLAY)
581
+ list(APPEND GEA_EMBEDDED_BOARD_SOURCES "${GEA_EMBEDDED_ROOT}/targets/esp32/display.cpp")
582
+ endif()
583
+ list(APPEND GEA_EMBEDDED_BOARD_SOURCES ${GEA_CUSTOM_TARGET_DISPLAY_SOURCES})
584
+ else()
585
+ list(APPEND GEA_EMBEDDED_BOARD_SOURCES
586
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/display.cpp"
587
+ "${GEA_CHIPS}/displays/co5300/co5300.cpp"
588
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/chip_bindings/displays/co5300.cpp"
589
+ )
590
+ endif()
591
+ set(GEA_EMBEDDED_TARGET_SERVICE_SOURCES
592
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/services/app_state.cpp"
593
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/services/frame_scheduler.cpp"
594
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/services/heap.cpp"
595
+ )
596
+ set(GEA_EMBEDDED_TARGET_HOST_SOURCES "")
597
+ set(GEA_EMBEDDED_TARGET_REQUIRES
598
+ esp_system
599
+ esp_timer
600
+ freertos
601
+ esp_lcd
602
+ driver
603
+ esp_mm
604
+ )
605
+
606
+ if(GEA_EMBEDDED_DIRECT_CANVAS_PROFILE)
607
+ set(GEA_FW_CXX_SOURCES_FOR_APP
608
+ "${GEA_ENGINE}/ui/canvas_element.cpp"
609
+ "${GEA_ENGINE}/canvas.cpp"
610
+ "${GEA_ENGINE}/bitmap_font.cpp"
611
+ "${GEA_ENGINE}/rasterized_font.cpp"
612
+ "${GEA_CORE}/app_frame_perf.cpp"
613
+ "${GEA_CORE}/runtime.cpp"
614
+ "${GEA_CORE}/events.cpp"
615
+ "${GEA_HOST}/host/timers.cpp"
616
+ "${GEA_HOST}/host/display.cpp"
617
+ )
618
+ set(GEA_FW_C_SOURCES_FOR_APP "")
619
+ list(APPEND GEA_EMBEDDED_DIRECT_CANVAS_COMPILE_DEFINITIONS
620
+ GEA_EMBEDDED_DIRECT_CANVAS_CONTEXT=1
621
+ GEA_EMBEDDED_WIFI_DISABLED=1
622
+ # Reserve the full 80-row x 2-deep flush pipeline statically (radios are
623
+ # off in this profile, so the internal RAM is genuinely free). Without
624
+ # the pool the lazy per-slot mallocs hit boot-time fragmentation and the
625
+ # pipeline descends to 16-row chunks — ~5x the QSPI per-transaction
626
+ # overhead on a bandwidth-bound link.
627
+ GEA_EMBEDDED_DISPLAY_FLUSH_POOL_BYTES=131200
628
+ # Present chunks stream as data-only continuations under one held CS
629
+ # (window+RAMWR once per region). The per-chunk drawBitmap path sends
630
+ # commands per chunk and esp_lcd drains ALL in-flight DMA before every
631
+ # command — measured ~18MB/s effective on the 40MB/s link with zero
632
+ # raster/DMA overlap. See display.cpp PRESENT_CS_HELD_STREAM comment.
633
+ # Enabled: the CS-held path is runtime-gated in display.cpp to the gea3d
634
+ # half-res present (presentScale_==2); every other app still takes the
635
+ # drawBitmap path, so this only changes the gea3d flythrough.
636
+ GEA_EMBEDDED_DISPLAY_CO5300_PRESENT_CS_HELD_STREAM=1
637
+ )
638
+ else()
639
+ # i2c.cpp, launcher_button.cpp and sdcard_mount.cpp are already NC-tolerant:
640
+ # each checks GPIO_NUM_NC and declines to bring its peripheral up, so a board
641
+ # that has none of them compiles and boots without special-casing. touch.cpp
642
+ # is not — it binds the FT3168 controller directly — so a board with no
643
+ # `chips.touch` takes the no-op Touchscreen instead.
644
+ list(APPEND GEA_EMBEDDED_BOARD_SOURCES
645
+ "i2c.cpp"
646
+ "launcher_button.cpp"
647
+ "sdcard_mount.cpp"
648
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/apps/app_manager.cpp"
649
+ )
650
+ # touch.cpp routes Touchscreen to the FT3168 controller. A board with no
651
+ # `chips.touch` gets touch_absent.cpp through the peripheral sources instead,
652
+ # so this only has to stop compiling the FT3168-bound file.
653
+ if(NOT GEA_CUSTOM_TARGET_ACTIVE OR GEA_CUSTOM_TARGET_HAS_TOUCH)
654
+ list(APPEND GEA_EMBEDDED_BOARD_SOURCES "touch.cpp")
655
+ endif()
656
+ if(GEA_EMBEDDED_CAPABILITY_NETWORK)
657
+ list(APPEND GEA_EMBEDDED_BOARD_SOURCES
658
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/connectivity/diagnostics_transport.cpp"
659
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/connectivity/wifi.cpp"
660
+ )
661
+ else()
662
+ # No Wi-Fi station is registered, so the diagnostics log has nowhere to
663
+ # go over TCP; the offline transport keeps the console path alive. The
664
+ # host facades (fetch/http/websocket) and app_main's driver
665
+ # registration all compile out on GEA_EMBEDDED_WIFI_DISABLED.
666
+ list(APPEND GEA_EMBEDDED_BOARD_SOURCES
667
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/connectivity/diagnostics_transport_offline.cpp"
668
+ )
669
+ list(APPEND GEA_EMBEDDED_CAPABILITY_COMPILE_DEFINITIONS
670
+ GEA_EMBEDDED_WIFI_DISABLED=1
671
+ GEA_EMBEDDED_NETWORK_SERVICES_DISABLED=1
672
+ GEA_EMBEDDED_OTA_DISABLED=1)
673
+ endif()
674
+ if(GEA_CUSTOM_TARGET_ACTIVE)
675
+ list(APPEND GEA_EMBEDDED_BOARD_SOURCES ${GEA_CUSTOM_TARGET_PERIPHERAL_SOURCES})
676
+ else()
677
+ list(APPEND GEA_EMBEDDED_BOARD_SOURCES
678
+ "${GEA_CHIPS}/power/axp2101/axp2101.cpp"
679
+ "${GEA_CHIPS}/imu/qmi8658/qmi8658.cpp"
680
+ "${GEA_CHIPS}/touch/ft3168/ft3168.cpp"
681
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/chip_bindings/power/axp2101.cpp"
682
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/chip_bindings/touch/ft3168.cpp"
683
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/chip_bindings/imu/qmi8658.cpp"
684
+ )
685
+ endif()
686
+ list(APPEND GEA_EMBEDDED_TARGET_SERVICE_SOURCES
687
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/services/app_runner.cpp"
688
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/services/battery_service.cpp"
689
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/services/device_control.cpp"
690
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/services/memory.cpp"
691
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/services/storage_service.cpp"
692
+ )
693
+ # Staging an OTA image is transport-agnostic, so it follows OTA itself rather
694
+ # than the network: BLE OTA streams the bytes over GATT and needs no network
695
+ # stack. The HTTP server in ota.cpp does, and stays network-gated.
696
+ if(GEA_EMBEDDED_CAPABILITY_NETWORK OR GEA_EMBEDDED_BLE_OTA_ENABLED)
697
+ list(APPEND GEA_EMBEDDED_TARGET_SERVICE_SOURCES
698
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/services/ota_image.cpp")
699
+ endif()
700
+ if(GEA_EMBEDDED_CAPABILITY_NETWORK)
701
+ list(APPEND GEA_EMBEDDED_TARGET_SERVICE_SOURCES
702
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/services/ota.cpp")
703
+ endif()
704
+ # ble_hid.cpp reports Wi-Fi state beside OTA state, so a BLE-OTA build with no
705
+ # network still needs those two symbols answered.
706
+ if(GEA_EMBEDDED_BLE_OTA_ENABLED AND NOT GEA_EMBEDDED_CAPABILITY_NETWORK)
707
+ list(APPEND GEA_EMBEDDED_TARGET_SERVICE_SOURCES
708
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/connectivity/wifi_debug_offline.cpp")
709
+ # esp_ota_ops.h lives in app_update, which the network branch below
710
+ # already requires. Writing an image needs it whatever carried the bytes.
711
+ list(APPEND GEA_EMBEDDED_TARGET_REQUIRES app_update)
712
+ endif()
713
+ if(GEA_EMBEDDED_CAPABILITY_NETWORK)
714
+ # host/rtc_esp.cpp is the WebRTC peer -- it includes esp_peer.h and drags
715
+ # the whole libpeer/libsrtp stack in with it. Only an app that reaches a
716
+ # network at all can have a peer to talk to.
717
+ list(APPEND GEA_EMBEDDED_TARGET_HOST_SOURCES
718
+ "${GEA_HOST}/host/rtc_esp.cpp"
719
+ )
720
+ endif()
721
+ # The board's speaker path -- the ES8311 codec binding, the audio runtime,
722
+ # and the I2S/codec components they need -- costs an app that never asks for
723
+ # sound nothing at all. Framework surfaces (HTMLAudioElement, the sound
724
+ # attributes, device control) still reference the AudioSystem backend, so the
725
+ # no-audio build answers them with the shared no-op stub.
726
+ if(GEA_EMBEDDED_CAPABILITY_AUDIO)
727
+ list(APPEND GEA_EMBEDDED_TARGET_HOST_SOURCES
728
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/chip_bindings/audio/es8311.cpp"
729
+ "${GEA_HOST}/audio_runtime.cpp"
730
+ )
731
+ list(APPEND GEA_EMBEDDED_TARGET_REQUIRES esp_driver_i2s esp_codec_dev)
732
+ list(APPEND GEA_EMBEDDED_CAPABILITY_COMPILE_DEFINITIONS GEA_EMBEDDED_APP_USES_AUDIO=1)
733
+ else()
734
+ list(APPEND GEA_EMBEDDED_TARGET_HOST_SOURCES
735
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/services/audio_runtime_stub.cpp"
736
+ )
737
+ list(APPEND GEA_EMBEDDED_CAPABILITY_COMPILE_DEFINITIONS GEA_EMBEDDED_AUDIO_UNUSED=1)
738
+ endif()
739
+ if(GEA_EMBEDDED_CAPABILITY_BLE)
740
+ list(APPEND GEA_EMBEDDED_TARGET_HOST_SOURCES
741
+ "${GEA_EMBEDDED_ROOT}/targets/esp32/connectivity/ble_hid.cpp"
742
+ )
743
+ list(APPEND GEA_EMBEDDED_TARGET_REQUIRES bt)
744
+ endif()
745
+ if(GEA_EMBEDDED_CAPABILITY_NETWORK)
746
+ list(APPEND GEA_EMBEDDED_TARGET_REQUIRES
747
+ lwip
748
+ esp_wifi
749
+ esp_http_server
750
+ esp_http_client
751
+ ${GEA_EMBEDDED_HTTPS_REQUIRES}
752
+ app_update
753
+ esp_netif)
754
+ endif()
755
+ list(APPEND GEA_EMBEDDED_TARGET_REQUIRES
756
+ # esp_app_format: app_manager reads the running image descriptor
757
+ # whether or not OTA is linked.
758
+ esp_app_format
759
+ # esp_flash_read_id: the OTA status endpoint reports the flash JEDEC id,
760
+ # which decides whether CONFIG_SPI_FLASH_AUTO_SUSPEND is safe on a board.
761
+ spi_flash
762
+ esp_event
763
+ nvs_flash
764
+ spiffs
765
+ esp_driver_i2c
766
+ esp_driver_usb_serial_jtag
767
+ esp_driver_sdmmc
768
+ sdmmc
769
+ fatfs
770
+ )
771
+ endif()
772
+
773
+ idf_component_register(
774
+ SRCS
775
+ ${GEA_EMBEDDED_BOARD_SOURCES}
776
+ # @geastack framework C/C++ sources — single source of truth: @geastack/core/gea_sources.sh
777
+ # (resolved via node_modules, shared with the web build). Covers engine/host/
778
+ # reactive/runtime/elements/geaos + AnimatedGIF. App/target-specific sources stay below.
779
+ ${GEA_FW_APP_SENSITIVE_SOURCES}
780
+ ${GEA_EMBEDDED_TARGET_SERVICE_SOURCES}
781
+ ${GEA_EMBEDDED_TARGET_HOST_SOURCES}
782
+ ${APP_GENERATED_SOURCES}
783
+ INCLUDE_DIRS
784
+ ${GEA_CUSTOM_TARGET_INCLUDE_DIR}
785
+ "include"
786
+ "${GEA_EMBEDDED_ROOT}/targets/esp32"
787
+ ${GEA_FW_INCLUDE_DIRS}
788
+ "${GEA_CHIPS}"
789
+ ${GEA_EMBEDDED_APP_NATIVE_INCLUDE_DIRS}
790
+ ${CMAKE_BINARY_DIR}
791
+ REQUIRES
792
+ gea_framework
793
+ ${GEA_EMBEDDED_TARGET_REQUIRES}
794
+ LDFRAGMENTS
795
+ )
796
+
797
+ # The generated geatsc runtime contains headers named string.h/number.h. Keep
798
+ # the app output on the quoted-include path so generated `"..."` imports resolve
799
+ # without letting libstdc++ system includes such as <cstring> accidentally pick
800
+ # up the generated string.h through a normal -I search directory.
801
+ target_compile_options(${COMPONENT_LIB} PRIVATE -iquote "${GENERATED_APP_DIR}")
802
+
803
+ # Persist the app-facing localStorage blob (config profiles, learned mappings)
804
+ # to the `storage` SPIFFS partition on the 32MB flash instead of the tiny, full
805
+ # NVS blob. See targets/esp32/services/storage_service.cpp and partitions.csv.
806
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE GEA_STORAGE_SPIFFS=1)
807
+
808
+ set(GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE 0)
809
+ if(DEFINED ENV{GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG})
810
+ set(GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE "$ENV{GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG}")
811
+ endif()
812
+
813
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE
814
+ ${GEA_CUSTOM_TARGET_COMPILE_DEFINITIONS}
815
+ GEA_EMBEDDED_PIXEL_PANEL_ENDIAN=1
816
+ GEA_CPP_ENABLE_REGEX=0
817
+ GEA_CPP_USE_TO_CHARS_DOUBLE=0
818
+ GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG=${GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG_VALUE}
819
+ GEA_EMBEDDED_CSS_DEVICE_PIXEL_RATIO=${GEA_EMBEDDED_CSS_DEVICE_PIXEL_RATIO}
820
+ GEA_EMBEDDED_HAS_GENERATED_FONTS=1
821
+ # Pin the frame ticker to core 0, where app_main/main_task also runs the
822
+ # runtime/render event loop. That keeps render submission on the same core as
823
+ # the display mutex + SPI/DMA-completion path and avoids the old per-boot
824
+ # cross-core flush wait lottery.
825
+ GEA_EMBEDDED_APP_FRAME_TASK_CORE=0
826
+ # Unite the coalesced dirty windows into one full-screen bbox when they're dense.
827
+ # MEASURED optimal for scattered 64-ball scenes: disabling it flushed HALF the
828
+ # pixels (199K->92K) but was SLOWER (47->35fps, inflush 13.3->20.5ms) because the
829
+ # tight windows fragment into 39 chunks and the CO5300 per-window/per-chunk setup
830
+ # penalty dominates. Fewer, bigger windows beat fewer pixels on this panel.
831
+ GEA_EMBEDDED_FLUSH_ADAPTIVE_COALESCE=1
832
+ # Opt this FPU-less ESP32-S3 board into single-precision `number` storage:
833
+ # geatsc's `gea_number` typedef (runtime/gea_number.h) becomes `float` instead
834
+ # of soft-float `double`, so per-frame reactive/animation math runs on the
835
+ # hardware FPU. Default (undefined) stays `double` for test262/host correctness.
836
+ GEA_NUMBER_FLOAT=1
837
+ # ONE master switch strips ALL per-frame perf instrumentation on this board —
838
+ # the app "gea.perf:" line, the scheduler "perf:"/"perf-lite:" harvest, per-op
839
+ # refresh & canvas timing, the requestAnimationFrame queue timing, and heap
840
+ # diagnostics. With it 0, every perf subsystem flag (defined in
841
+ # lib/gea-embedded/include/gea_perf_config.h) is forced off: no esp_timer reads,
842
+ # no counter increments, no stat resets, no log output — zero machinery. Set it
843
+ # to 1 (or override an individual sub-flag) to profile. See gea_perf_config.h.
844
+ # Production build: ALL perf instrumentation stripped (this is how the user's
845
+ # 60fps reference was measured). The ungated PRODFPS probe in frame_scheduler.cpp
846
+ # reports the true frame rate independently.
847
+ GEA_EMBEDDED_PERF=0
848
+ GEA_EMBEDDED_FRAME_SCHEDULER_PERF_LOG=0
849
+ GEA_EMBEDDED_FRAME_SCHEDULER_PERF_LITE=0
850
+ GEA_EMBEDDED_TEXT_SPRITE_DIAG=0
851
+ # css-3d-cube reads transform+gradient every frame on every node; embed the rare
852
+ # fields inline in ComputedStyle (direct load, spine's access pattern) instead of the
853
+ # rstyle() pool indirection. (Eventually geatsc sets this per-app from static usage.)
854
+ GEA_EMBEDDED_RARE_STYLE_INLINE=1
855
+ # Per-app: skip b300e2d's O(N^2) subtreeRevealsUnrecordedContent reveal-check for apps
856
+ # whose content never pans off-clip (bouncing-balls-jsx). See the value block above.
857
+ GEA_EMBEDDED_SUBTREE_REVEAL_CHECK=${GEA_EMBEDDED_REVEAL_CHECK_VALUE}
858
+ GEA_EMBEDDED_SKIP_POSITION_INLINE_RECORD=${GEA_EMBEDDED_SKIP_POSITION_RECORD_VALUE}
859
+ # DIAG 2026-07-08: uniting dirty into one full-screen bbox saves ~1.2ms of
860
+ # dirty-tracking but forces the RENDER to re-rasterize every node in the bbox
861
+ # each frame — including the static 26vmin FPS badge, measured at t:2136us/frame
862
+ # (bigger than all 64 balls' fill). Keeping the sparse per-ball rects lets the
863
+ # replay re-raster the badge only where a ball actually overlaps it ("only
864
+ # re-render the changing parts"); the flush still coalesces via ADAPTIVE_COALESCE.
865
+ GEA_EMBEDDED_BROAD_DIRTY_BBOX=1
866
+ GEA_EMBEDDED_DISPLAY_CO5300_FRAMEBUFFER_STREAM_FLUSH=1
867
+ # Per-app: pipeline the fused framebuffer flush like the present path (see value
868
+ # block above). Takes priority over FRAMEBUFFER_STREAM_FLUSH's draining txColor
869
+ # in display.cpp (streamFlush only runs when csHeldStream is false).
870
+ GEA_EMBEDDED_DISPLAY_CO5300_FRAMEBUFFER_CS_HELD_STREAM=${GEA_EMBEDDED_FB_CS_HELD_VALUE}
871
+ # CS-held data-only present stream (window+RAMWR once per region, chunks stream as
872
+ # continuations under one held CS). The per-chunk drawBitmap path drains ALL in-flight
873
+ # DMA before every command, serializing raster against the wire (~18MB/s effective,
874
+ # measured [chunk.probe] overlap=0). CS-held keeps the queue command-free mid-stream so
875
+ # a chunk's raster overlaps the previous chunk's DMA → flush approaches the 40MB/s wire
876
+ # floor (~10.3ms). Runtime-gated in display.cpp to any full-region present.
877
+ GEA_EMBEDDED_DISPLAY_CO5300_PRESENT_CS_HELD_STREAM=1
878
+ # NOTE (2026-07-07): overlapping the flush with the app's next-frame compute by moving
879
+ # the flush to a separate present task was tested in 4 configs, all WORSE than the
880
+ # inline 50fps: core-1 task DEADLOCKS (CO5300 held-CS SPI wedge); same-core (low-prio,
881
+ # high-prio single-buffer, high-prio double-buffer) all ~28fps — the flush slows to
882
+ # ~18ms on the present task and the app still serializes against it. So the flush
883
+ # stays inline on the app frame task; compute+flush can't overlap here. Full-screen-
884
+ # dirty canvas apps are capped at ~50fps by the CO5300 SPI serialization + 40MB/s QSPI.
885
+ # Single-buffer: the flush is synchronous on the app frame task (the CO5300 holds CS
886
+ # across the chunked DMA, so a background present task deadlocks), so a second
887
+ # framebuffer buys no app/flush overlap here — measured no change (still 47fps).
888
+ GEA_EMBEDDED_DISPLAY_DOUBLE_BUFFER=0
889
+ # NOTE (profiled 2026-06-23): flushing scattered balls as precise per-rect windows
890
+ # instead of the coalesced bounding box was measured WORSE (43 vs 50fps): this
891
+ # board's narrow QSPI flush runs ~4.5 px/us vs ~45 px/us wide, and 54 small chunks
892
+ # multiply the per-chunk fused-raster cost. The bounding-box / adaptive-coalesce
893
+ # flush is the correct design here; the 51->60 gap is retained COMPUTE, not flush.
894
+ # (kept DIRTY_REGION_MAX_RECTS at its 32 default; raising it only helped precision,
895
+ # which the flush then undoes for good reason.)
896
+ # This board's flush cost is per-pixel (PSRAM->staging copy) with ~0 per-window setup,
897
+ # so coalescing scattered dirty rects into gap-filled bands is pure waste — it spiked the
898
+ # copy to ~10ms on wide-dirty (spread-balls) frames and missed the TE. Tighten the dirty
899
+ # gap-merge to near-touching rects only so the flush copies the balls, not the gaps.
900
+ GEA_EMBEDDED_DIRTY_COALESCE_GAP_SHIFT=3
901
+ # Old-spine comparison mode: persistent framebuffer path, no replay-fused
902
+ # flush. This keeps canvas-3d on the path used by the 70-90fps historical
903
+ # measurements while we compare the newer runtime/binary size separately.
904
+ GEA_EMBEDDED_DISPLAY_FUSE_REPLAY_FLUSH=${GEA_EMBEDDED_FUSE_FLUSH_VALUE}
905
+ # Golden (e6614f6a, 62fps) used no partial-flush edge pad and showed no smudge.
906
+ # The 2px all-sides pad inflates every per-rect ball flush window (~24/frame:
907
+ # 15k -> 24k px). Drop it; if the CO5300 left-edge smudge reappears it's a
908
+ # separate regression to fix at its source, not by padding every flush.
909
+ GEA_EMBEDDED_DISPLAY_PARTIAL_FLUSH_EDGE_PAD_PX=0
910
+ # QSPI display SPI clock. 80 MHz is the panel's proven rate and the source
911
+ # default (display.cpp). Pinned explicitly here because the build had drifted
912
+ # to an effective 60 MHz (no CMake/cache/source basis — a stale configure
913
+ # artifact). A full-screen flush is 410x502x2B = 411 KB, bandwidth-bound over
914
+ # the 4 QSPI lanes, so the clock sets flush time linearly: 80 MHz (~40 MB/s,
915
+ # ~10.3 ms) vs 60 MHz (~30 MB/s, ~13.7 ms). Dominates full-screen canvas apps.
916
+ GEA_EMBEDDED_DISPLAY_QSPI_PCLK_HZ=80000000
917
+ # Direct PSRAM->SPI framebuffer flush: DISABLED — we use the
918
+ # PSRAM->internal-staging->SPI path instead. Exhaustively tested (PSRAM at
919
+ # 80/60/40/20 MHz, GDMA burst 32/64B, and PSRAM overclocked to 120 MHz): the
920
+ # GDMA can't keep the 64-byte SPI TX FIFO fed straight from octal PSRAM for a
921
+ # full-frame stream, so it underflows, and the underflow recovery hangs the
922
+ # frame task. Staging is the correct, stable 60 fps path on this board.
923
+ # STATIC_BACKDROP: ON. Worth ~18 fps here; two wrong turns are recorded so
924
+ # neither is repeated.
925
+ #
926
+ # Wrong turn 1 -- blamed for a rendering artifact. On 2026-09-15 this flag was
927
+ # switched off to chase byte-swapped magenta/orange pixels along css-3d-cube's
928
+ # face seams, on the theory that the per-frame blit window stranded stale colours
929
+ # at a CO5300 dropped column. The flag was innocent. Those pixels came from
930
+ # scalarPx in drawTransformedLinearGradient pairing a toRgb565 read (panel ->
931
+ # normal) with a toNative write. toNative is the FORMAT converter and is the
932
+ # identity on RGB565, so it applies NO panel-endian swap -- every pixel that path
933
+ # wrote landed byte-swapped. It showed only at span heads/tails (the cube
934
+ # silhouette) and on geometry too thin to reach the aligned PIE path (the 2px
935
+ # horizon), which is what made it look like a seam artifact. Fixed in core
936
+ # (render.cpp); with that fix the corruption is gone AND the backdrop is on.
937
+ #
938
+ # Wrong turn 2 -- reading the absence of [bdrop] lines as "never engages".
939
+ # It means the opposite. The cache bakes ONCE at settle and a kQuiet frame KEEPS
940
+ # it (tree_render.cpp), so a healthy steady state logs nothing at all; a log line
941
+ # appears only on a bake or a drop. Nor does recprobe fullrebuilds:90/90 mean the
942
+ # path is idle -- that counts display-list RECORDS, which is a different question
943
+ # from whether the backdrop pixels are blitted. The counter that does answer it is
944
+ # `tree(count:N direct:N)`, and it is a PER-FRAME average (treeRefreshCalls /
945
+ # frameCount, treeDirectReplayCalls / frameCount -- frame_scheduler.cpp), so
946
+ # direct:1 is "direct replay on every refreshing frame", not "1 frame in 90".
947
+ #
948
+ # Measured, css-3d-cube translucent, 55s windows: ON 50-56 fps (mean 52),
949
+ # OFF 31-44 fps (mean 34). Turning it off also switches off the transform
950
+ # reproject, which is gated on staticBackdropActive().
951
+ GEA_EMBEDDED_DISPLAY_STATIC_BACKDROP=1
952
+ GEA_EMBEDDED_DISPLAY_DIRECT_PSRAM_FLUSH=0
953
+ # No mid-stream pacing on full-frame flushes. PACE_CHUNKS>0 forces a full
954
+ # waitForFlushComplete() drain every N RAMWRC chunks. Measured: dropping
955
+ # from 4 to 0 only saved ~0.8 ms of the ~6 ms per-flush wait — most of that
956
+ # wait is 2-slot flush-semaphore backpressure (16-row pool, internal-RAM
957
+ # starved), not the pace drain. Still keep 0: the semaphore already
958
+ # backpressures the queue so the pace is redundant, and it's the source
959
+ # default. (Was =4 to reproduce an old canvas-3d spine baseline.)
960
+ GEA_EMBEDDED_DISPLAY_CO5300_STREAM_PACE_CHUNKS=0
961
+ GEA_EMBEDDED_DISPLAY_DIRECT_PSRAM_STREAM_PACE_CHUNKS=0
962
+ GEA_EMBEDDED_DISPLAY_DIRECT_PSRAM_RAMWRC_CONTINUE=1
963
+ GEA_EMBEDDED_DISPLAY_DIRECT_PSRAM_CS_HELD_STREAM=1
964
+ GEA_EMBEDDED_DISPLAY_DIRECT_PSRAM_MAX_TRANSFER_BYTES=32256
965
+ GEA_EMBEDDED_DISPLAY_DIRECT_PSRAM_STATIC_TX_PROBE=0
966
+ GEA_EMBEDDED_DISPLAY_DIRECT_PSRAM_STATIC_TX_PROBE_IDLE_FLUSH=0
967
+ GEA_EMBEDDED_DISPLAY_DIRECT_PSRAM_EDGE_GUARD_BYTES=0
968
+ GEA_EMBEDDED_DISPLAY_DIRECT_PSRAM_STAGED_PREFIX_ROWS=0
969
+ GEA_EMBEDDED_DISPLAY_DIRECT_PSRAM_ALIGN_TRANSFERS=1
970
+ # Real direct-PSRAM: packed stride (410 px, 820 B/row) keeps the framebuffer
971
+ # contiguous so flushFramebufferRectDirect takes the directBytes branch and
972
+ # GDMA reads PSRAM with no internal-RAM staging. CS_HELD_STREAM=1 above keeps
973
+ # the SPI tx open across the whole frame so the touch task can't yield
974
+ # between segments and starve the FIFO. REQUIRE_LENGTH_ALIGNMENT=0 lets the
975
+ # final 6-row tail also flow direct from PSRAM (vs being staged through an
976
+ # internal-RAM buffer). The GDMA hardware accepts non-64-aligned descriptor
977
+ # tails; the matching esp_cache_msync uses ESP_CACHE_MSYNC_FLAG_UNALIGNED.
978
+ GEA_EMBEDDED_DISPLAY_DIRECT_PSRAM_REQUIRE_LENGTH_ALIGNMENT=0
979
+ GEA_EMBEDDED_DISPLAY_SOFTWARE_SCROLL_PADDED_STRIDE=0
980
+ GEA_EMBEDDED_DISPLAY_DIRECT_PSRAM_PADDED_ROW_STREAM=0
981
+ # Only relevant when DIRECT_PSRAM_FLUSH=1 (disabled above). Left at 0.
982
+ GEA_EMBEDDED_CO5300_SPI_MANUAL_DMA_ALIGN_FLAG=0
983
+ # Was =1 from an old display-pacing experiment (f06ad9724) that disabled the
984
+ # then-broken queueFrameEvent catch-up. =0 re-enables catch-up, now driven by
985
+ # the work-based, event-loop graceful-overrun path (frame_scheduler/runtime).
986
+ GEA_EMBEDDED_FRAME_SCHEDULER_DROP_CATCHUP_FRAMES=0
987
+ GEA_EMBEDDED_APP_FRAME_TASK_PRIORITY=23
988
+ # (perf-lite and all other perf sub-flags are governed by GEA_EMBEDDED_PERF=0 above.)
989
+ # 2-core replay split: defaults (96 rows / 64k px) only engage at the largest
990
+ # dirty phases of an animated-transform scene; lower so mid-size regions split
991
+ # too. Measured on css-3d-cube (glassy): median 52.3 -> 59.2 fps, min 44 -> 49.
992
+ GEA_EMBEDDED_RENDER_PARALLEL_MIN_ROWS=48
993
+ GEA_EMBEDDED_RENDER_PARALLEL_MIN_PIXELS=24000
994
+ ${GEA_EMBEDDED_DIRECT_CANVAS_COMPILE_DEFINITIONS}
995
+ ${GEA_EMBEDDED_BLE_COMPILE_DEFINITIONS}
996
+ ${GEA_EMBEDDED_HTTPS_COMPILE_DEFINITIONS}
997
+ ${GEA_EMBEDDED_CAPABILITY_COMPILE_DEFINITIONS}
998
+ # Serve device logs over TCP 8081 (`scripts/board ota-monitor` already speaks
999
+ # the framing). This board has the internal DRAM for the ~6 KiB task since
1000
+ # the IPC task stacks were cut from 16 KiB to 4 KiB, and without it a board
1001
+ # whose USB console has dropped has no way to show a log at all.
1002
+ GEA_EMBEDDED_DIAGNOSTICS_ENABLED=1
1003
+ )
1004
+
1005
+ # Production lockdown: gated by CONFIG_GEA_EMBEDDED_PRODUCTION_LOCKDOWN (sdkconfig.defaults).
1006
+ # When enabled, adds defines that compile out perf/heap logs and disable diagnostics server.
1007
+ if(CONFIG_GEA_EMBEDDED_PRODUCTION_LOCKDOWN)
1008
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE
1009
+ GEA_EMBEDDED_FRAME_SCHEDULER_PERF_LOG=1
1010
+ GEA_EMBEDDED_HEAP_DIAGNOSTICS_LOG=0
1011
+ GEA_FRAME_PERF_LOG=0
1012
+ GEA_EMBEDDED_DIAGNOSTICS_DISABLED=1
1013
+ )
1014
+ endif()
1015
+
1016
+ target_compile_options(${COMPONENT_LIB} PRIVATE
1017
+ -Wno-unused-parameter
1018
+ -Wno-sign-compare
1019
+ -Wno-missing-field-initializers
1020
+ -Wno-implicit-fallthrough
1021
+ $<$<COMPILE_LANGUAGE:C>:-Wno-old-style-declaration>
1022
+ -Wno-misleading-indentation
1023
+ -Wno-type-limits
1024
+ -Wno-maybe-uninitialized
1025
+ -Wno-calloc-transposed-args
1026
+ -Wno-unused-function
1027
+ -Wno-clobbered
1028
+ # Interleave literal pools with code for every gea framework/runtime TU (not
1029
+ # just the generated app archive): the decomposed framework sources each instantiate the
1030
+ # shared gea_cpp_value COMDATs (record_get, callable helpers), whose large
1031
+ # functions otherwise overflow the xtensa l32r literal range at link
1032
+ # ("dangerous relocation: l32r: literal target out of range"). xtensa-only —
1033
+ # empty on riscv (esp32-p4), where the flag is rejected. See gea_framework.cmake.
1034
+ ${GEA_XTENSA_LITERALS}
1035
+ )
1036
+
1037
+ # --- App compilation: vite-plugin-gea -> geatsc ---
1038
+
1039
+ _gea_collect_app_sources(_ACTIVE_APP_SRCS "${GEA_EMBEDDED_APP_DIR}")
1040
+ _gea_collect_app_assets(_ACTIVE_APP_ASSETS "${GEA_EMBEDDED_APP_DIR}")
1041
+ # The Gea compiler emits JS and IR, then geatsc emits C++. We use a stamp file as
1042
+ # the canonical OUTPUT because geatsc now writes a source manifest plus multiple
1043
+ # translation units. The generated archive consumes geatsc-sources.txt after this
1044
+ # command has completed.
1045
+ set(_GEATSC_BIN "${GEA_COMPILER}/dist/cli.js")
1046
+ set(_GEATSC_BUILD_STAMP "${GENERATED_APP_DIR}/geatsc_build.stamp")
1047
+ set(_GEA_VITE_GEATSC_SCRIPT "${GEA_CORE}/scripts/build-gea-vite-geatsc.mjs")
1048
+ file(GLOB_RECURSE _GEATSC_DIST_SRCS CONFIGURE_DEPENDS
1049
+ "${GEA_COMPILER}/dist/*.js"
1050
+ "${GEA_COMPILER}/dist/targets/cpp/runtime/*.cpp"
1051
+ "${GEA_PLUGIN}/dist/*.js"
1052
+ )
1053
+ add_custom_command(
1054
+ OUTPUT ${_GEATSC_BUILD_STAMP}
1055
+ COMMAND ${CMAKE_COMMAND} -E env
1056
+ "GEA_EMBEDDED_DIRECT_CANVAS_CONTEXT=${GEA_EMBEDDED_DIRECT_CANVAS_CODEGEN}"
1057
+ "GEA_EMBEDDED_NUMBER_F32=${GEA_EMBEDDED_NUMBER_F32}"
1058
+ node ${_GEA_VITE_GEATSC_SCRIPT}
1059
+ --app-dir ${GEA_EMBEDDED_APP_DIR}
1060
+ --entry ${GEA_EMBEDDED_APP_ENTRY}
1061
+ --cpp-board "${GEA_EMBEDDED_CPP_BOARD}"
1062
+ --out-dir ${GENERATED_APP_DIR}
1063
+ --geatsc-bin ${_GEATSC_BIN}
1064
+ --font-device-pixel-ratio ${GEA_EMBEDDED_CSS_DEVICE_PIXEL_RATIO}
1065
+ --pixel-panel-endian 1
1066
+ --gea-ir-backend
1067
+ # gea.compilerPlugins: an app's own geatsc plugins, e.g. the one that
1068
+ # declares its native host-function boundary. Empty for most apps.
1069
+ ${GEA_EMBEDDED_APP_GEATSC_PLUGIN_ARGS}
1070
+ COMMAND ${CMAKE_COMMAND} -E touch ${_GEATSC_BUILD_STAMP}
1071
+ DEPENDS
1072
+ ${GEA_EMBEDDED_APP_GEATSC_PLUGINS}
1073
+ ${_ACTIVE_APP_SRCS}
1074
+ ${_ACTIVE_APP_ASSETS}
1075
+ ${_GEATSC_BIN}
1076
+ ${_GEATSC_DIST_SRCS}
1077
+ ${_GEA_COMPILER_DEP_SRCS}
1078
+ ${_GEA_FONT_ASSETS}
1079
+ BYPRODUCTS
1080
+ "${GEATSC_SOURCE_LIST}"
1081
+ "${GENERATED_APP_DIR}/entry.cpp"
1082
+ "${GENERATED_APP_DIR}/generated_support.hpp"
1083
+ "${GENERATED_APP_DIR}/runtime.cpp"
1084
+ "${GENERATED_APP_DIR}/runtime_pch.h"
1085
+ ${GENERATED_CONFIG_H}
1086
+ ${GENERATED_FONT_CPP}
1087
+ ${GENERATED_FONT_H}
1088
+ ${GENERATED_ASSETS_CPP}
1089
+ "${GENERATED_APP_DIR}/gea-vite-bundle.js"
1090
+ COMMENT "Compiling ${GEA_EMBEDDED_APP}: TSX -> JS via vite-plugin-gea -> C++ via geatsc"
1091
+ VERBATIM
1092
+ )
1093
+ add_custom_target(geatsc_build ALL DEPENDS ${_GEATSC_BUILD_STAMP})
1094
+ gea_geatsc_add_generated_archive(
1095
+ TARGET ${COMPONENT_LIB}
1096
+ NAME geatsc_active_archive
1097
+ SOURCE_LIST "${GEATSC_SOURCE_LIST}"
1098
+ OUTPUT "${GEATSC_ARCHIVE}"
1099
+ DEPENDS ${_GEATSC_BUILD_STAMP}
1100
+ COMPILE_OPTIONS ${GEATSC_COMPILE_OPTIONS}
1101
+ COMPILE_DEFINITIONS ${GEATSC_COMPILE_DEFINITIONS}
1102
+ )
1103
+ # The Unix Makefiles generator emits the geatsc_build.stamp rule in a
1104
+ # separate sub-make from the archive target. On a cold build both reach the
1105
+ # stamp independently and run the TSX->C++ compile twice in parallel, racing
1106
+ # on the shared apps/<app>/module-graph dir (ENOTEMPTY). Order the archive
1107
+ # after geatsc_build so the stamp is already fresh and the compile runs once.
1108
+ add_dependencies(geatsc_active_archive geatsc_build)
1109
+
1110
+ # Embedded image assets (gea_asset_*): the generated TU defines weak const
1111
+ # arrays referenced from libgea_active_geatsc.a. Weak-only archive members are
1112
+ # never extracted to resolve a cross-archive reference, so force the dedicated
1113
+ # asset archive in. Keep the archive and both linker-state switches in one
1114
+ # argument: otherwise CMake can separate the switches across IDF's repeated
1115
+ # dependency groups. --gc-sections still drops unused asset sections.
1116
+ add_library(gea_active_app_assets STATIC "${GENERATED_ASSETS_CPP}")
1117
+ add_dependencies(gea_active_app_assets geatsc_build)
1118
+ target_link_libraries(${COMPONENT_LIB} PRIVATE
1119
+ "-Wl$<COMMA>--whole-archive$<COMMA>$<TARGET_FILE:gea_active_app_assets>$<COMMA>--no-whole-archive")
1120
+
1121
+ gea_framework_inherit_build_settings()