Files
MeshCore-Solo/variants/sim/platformio.ini
T
Jakub 8f4c92a217 feat(sim): add variants/sim/ — real companion_radio firmware on native + Emscripten
New board variant compiling the unmodified MyMesh/UITask/DataStore app
logic against real mesh::Radio/MainBoard/RTCClock/RNG interfaces, for
running the actual firmware outside embedded hardware:

- Native (plain g++, platform = native): ASCII-art display over stdout,
  stdin-driven input, local-disk-backed DataStore/IdentityStore.
- Emscripten/WASM (variants/sim/build_wasm.sh, since PlatformIO's native
  platform force-overrides any CC/CXX toolchain override back to system
  clang++): canvas-backed display, IDBFS-backed persistence across page
  reloads, JS-callable input via sim_enqueue_key(), emscripten_set_main_loop.

Real rweather/Crypto (AES128/SHA256/Ed25519) vendored unmodified and
proven working on both targets. variants/sim/web/index.html is a bare
verification harness, not the polished website embed.
2026-09-03 00:46:47 +02:00

65 lines
2.5 KiB
INI

; variants/sim -- native (host) build of the real companion_radio app logic
; (MyMesh/UITask/DataStore), for Phase 1 of the in-house browser-sim project
; (see the plan doc / project memory for the full Emscripten roadmap this is
; step one of). No Emscripten here yet -- plain g++, a terminal ASCII-art
; "display", stdin for input. Deliberately the easiest possible target so the
; from-scratch port can be debugged without WASM complexity on top.
;
; Not `extends`-ing arduino_base/esp32_base etc: those pull in RadioLib, Wire,
; SPI and a real Arduino framework, none of which this build wants -- it's
; written against platform=native from scratch, closer in spirit to
; [env:native]/[env:native_kiss_modem] below than to a real board env.
[env:sim_companion_radio]
platform = native
build_type = debug
build_flags =
-std=c++17
-g
; ARM toolchains (every real board target) default `char` to UNSIGNED;
; x86/ARM64 host compilers default it to signed. The UI's KEY_* codes
; (src/helpers/ui/UIScreen.h) go up to 0xF3 and get compared/stored as
; plain `char` throughout (KeyboardWidget.h, PopupMenu.h, UITask.cpp) --
; without this flag those comparisons are silently always-false on a
; signed-char host (a negative char never equals a positive KEY_* int
; literal), which would make keyboard input compile cleanly but never
; actually navigate anything.
-funsigned-char
-D SIM_PLATFORM
-D MESH_DEBUG=0
-D DISPLAY_CLASS=SimDisplayDriver
-D MAX_CONTACTS=100
-D MAX_GROUP_CHANNELS=8
-I variants/sim/arduino
-I variants/sim
-I variants/sim/thirdparty/crypto
-I variants/sim/thirdparty/cayennelpp
-I variants/sim/thirdparty/arduinojson
-I lib/ed25519
-I src
-I examples/companion_radio
-I examples/companion_radio/ui-new
build_src_filter =
-<*>
+<../src/Dispatcher.cpp>
+<../src/Identity.cpp>
+<../src/Mesh.cpp>
+<../src/Packet.cpp>
+<../src/Utils.cpp>
+<../src/helpers/AdvertDataHelpers.cpp>
+<../src/helpers/BaseChatMesh.cpp>
+<../src/helpers/ClientACL.cpp>
+<../src/helpers/CommonCLI.cpp>
+<../src/helpers/ConfigSerializer.cpp>
+<../src/helpers/DeviceDiag.cpp>
+<../src/helpers/IdentityStore.cpp>
+<../src/helpers/RegionMap.cpp>
+<../src/helpers/StaticPoolPacketManager.cpp>
+<../src/helpers/TransportKeyStore.cpp>
+<../src/helpers/TxtDataHelpers.cpp>
+<../lib/ed25519/*.c>
+<../variants/sim/*.cpp>
+<../variants/sim/thirdparty/crypto/*.cpp>
+<../variants/sim/thirdparty/cayennelpp/*.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>