From c958c7d61a1fa5e1fe1aadeea98078b7cba76a56 Mon Sep 17 00:00:00 2001 From: proddy Date: Fri, 24 Oct 2025 18:05:12 +0200 Subject: [PATCH 1/2] fix native --- platformio.ini | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/platformio.ini b/platformio.ini index c588f7d9a..6d13b354e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -179,29 +179,14 @@ build_flags = ${common.build_flags} -DBOARD_C6 -; -; Building and testing natively, standalone without an ESP32. -; See https://docs.platformio.org/en/latest/platforms/native.html -; -; It will generate an executable which when run will show the EMS-ESP Console where you can run tests using the `test` command. -; -; See https://docs.platformio.org/en/latest/core/installation/shell-commands.html#piocore-install-shell-commands -; -; to build and run directly on linux: pio run -e native -t exec -; -; to build and run on Windows, it needs winsock for the console input so: -; - For the first time, install Msys2 (https://www.msys2.org/) and the GCC compiler with `run pacman -S mingw-w64-ucrt-x86_64-gcc` -; - Then, build with `pio run -e native` to create the program.exe file -; - run by calling the executable from the Mysys shell e.g. `C:/msys64/msys2_shell.cmd -defterm -here -no-start -ucrt64 -c /.pio/build/native/program.exe` -; - or use with Windows Terminal https://www.msys2.org/docs/terminals/ -; +; foundation for building and testing natively, standalone without an ESP32. [env:native] platform = native build_type = debug +build_flags = build_src_flags = - -DARDUINOJSON_ENABLE_ARDUINO_STRING=1 -DEMSESP_STANDALONE -DEMSESP_TEST - -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.7.3-dev.0\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\" + -DARDUINOJSON_ENABLE_ARDUINO_STRING=1 -std=gnu++17 -Og -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-missing-braces @@ -272,6 +257,27 @@ lib_deps = Unity test_testing_command = ${platformio.build_dir}/${this.__env__}/program +; +; Building and testing locally on OS, which we call "standalone" without an ESP32. +; See https://docs.platformio.org/en/latest/platforms/native.html +; +; It will generate an executable which when run will show the EMS-ESP Console where you can run tests using the `test` command. +; +; See https://docs.platformio.org/en/latest/core/installation/shell-commands.html#piocore-install-shell-commands +; +; to build and run directly on linux: pio run -e standalone -t exec +; +; to build and run on Windows, it needs winsock for the console input so: +; - For the first time, install Msys2 (https://www.msys2.org/) and the GCC compiler with `run pacman -S mingw-w64-ucrt-x86_64-gcc` +; - Then, build with `pio run -e standalone` to create the program.exe file +; - run by calling the executable from the Mysys shell e.g. `C:/msys64/msys2_shell.cmd -defterm -here -no-start -ucrt64 -c /.pio/build/native/program.exe` +; - or use with Windows Terminal https://www.msys2.org/docs/terminals/ +; +[env:standalone] +extends = env:native +build_flags = + -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.7.3-dev.0\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\" + ; Modbus ; Creating the modbus registers is a multi-step process. Before it was in a shell script called generate_csv_and_headers.sh ; but now moved to pio so everything is in python and cross-platform. The logic is as follows: From efa2c8fc4b5c773c7839d57fb5fa3e0d39323204 Mon Sep 17 00:00:00 2001 From: proddy Date: Fri, 24 Oct 2025 18:06:52 +0200 Subject: [PATCH 2/2] rename native to standalone --- .github/workflows/pr_check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index cfde3c9cb..f7892bb1d 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -32,6 +32,6 @@ jobs: pip install wheel pip install -U platformio - - name: Build native + - name: Build standalone run: | - platformio run -e native + platformio run -e standalone