17 Commits
Author SHA1 Message Date
andrey 94084fb351 Merge branch 'master' into webasm
Переработка ветки под систему фиче-флагов master:
- CMake-секция PIP_WASM (платформа, аналог PICO/FREERTOS): принудительный
  OFF PIP_HAS_SOCKET/PROCESS/DYNLIB/SERIAL и PIP_BUILD_CONSOLE/USB/OPENCL/
  FFTW/LUA/MQTT_CLIENT/HTTP_SERVER/HTTP_CLIENT до pip_resolve_feature_flags();
  таблица зависимостей довыключает client_server/cloud/introspection
- Файлы, покрытые фиче-флагами master (piethernet/piserial/pican/pilibrary/
  piprocess): взята master-версия, EMSCRIPTEN-стубы webasm удалены как
  мёртвый код (нет флага — нет класса)
- Сохранены EMSCRIPTEN-гварды там, где флаги не покрывают поведение:
  pihidevice (компилируется под wasm), piinit (initSignals/initLocale/
  initUsername/initOSname/initHWInfo), pisysteminfo (instance/machineKey),
  pithread (gettid-фоллбэк), picout (EM_ASM console.log),
  pibase_macros (PIP_MIN_MSLEEP), pipiplatform.h (EMSCRIPTEN/ARCH_BITS)
- Исправлен AUTO-merge в PISystemInfo::machineKey() (семантический баг:
  пустой результат при PIP_HAS_FILESYSTEM=OFF)

Проверено: нативный ctest 364/364 (build-verify), wasm-сборка (build_wasm,
лишь libpip.a + libpip_io_utils.a + pcre2), node-смоук-тест PICout/PISystemInfo
2026-09-19 11:01:39 +03:00
andrey 8e9ba0298e fix: guard RTTI/threads/filesystem dependent code for arbitrary flag combinations 2026-08-31 17:10:38 +03:00
andrey 69b22bf95a feat: complete PIP_HAS_* feature guards in code and auto-generate flag summary
Guard PIConnection, thread primitives, PICodeParser and other feature
code behind PIP_HAS_THREADS/PIP_HAS_FILESYSTEM. In CMake generate the
feature flags summary from the single PIP_HAS_FLAGS list (used by the
add_definitions loop as well), default ICU to OFF and make introspection
also require PIP_HAS_SOCKET. Build system/thread test suites only when
the corresponding feature flags are enabled.
2026-08-25 11:14:25 +03:00
andrey 8fc2be8dd9 fix: complete PIP_HAS_* flag matrix and restore ESP32/FreeRTOS support
- CMake: disable thread/socket-dependent modules (http_client, mqtt_client,
  client_server) and fftw when the required feature flags are off;
  client_server/cloud no longer tied to the crypt option
- host utils gated on filesystem and the modules they need
- Pico keeps the minimal set; generic FreeRTOS (ESP32) keeps filesystem,
  sockets and serial as in master, module set limited to crypt/compress/io_utils
- PICAN, PIBroadcast, PIPackedTCP vanish without socket+threads
- PISerial: restore PISERIAL_NO_PINS (auto-enabled on PIP_EMBEDDED)
- PIFile: FREERTOS uses fopen/stat (no fopen64 in ESP-IDF newlib)
- drop invalid PICout buffer guards, guard PIObject::deleteLater,
  remove (void)destroying hack, fake PIHIDevice non-Linux stub and the
  redundant PICO_SDK guard in code_model_generator
2026-08-22 19:23:22 +03:00
andrey 32066e3a8c fix: make PIP buildable for no-threads and no-filesystem flag combinations
Found while verifying -DPIP_HAS_THREADS=OFF / -DPIP_HAS_FILESYSTEM=OFF
smoke builds (pre-existing gaps of the branch):

- piinit.cpp: full implementation now requires PIP_HAS_THREADS as well
  (the PIInit class is declared in piinit.h only with threads; without
  threads PIInit is absent altogether, stub/absent branches unchanged)
- PIWaitEvent: drop the PIP_HAS_THREADS guard - it is a plain
  pipe/select/WaitForMultipleObjects wrapper with no thread usage
  (master had no guard), restores unistd.h include for PICAN etc.
- PIEthernet: guard server_thread_ member, server_func(), threaded
  listen/stop parts and writeThreaded() calls by PIP_HAS_THREADS
- PIPeer: guard class/impl by PIP_HAS_THREADS (uses PIThread/PITimer/
  PIDiagnostics), openDevice() /etc/pip.conf read by PIP_HAS_FILESYSTEM
- PIBinaryLog::restart(): guard threaded-read restart by PIP_HAS_THREADS
- PIIODevice::configure(config_file,...), PIConnection::configureFromConfig,
  PIConfig include resolution: guard path-based bodies by PIP_HAS_FILESYSTEM
- PISerial::availableDevicesInfo(): guard /dev and /proc/tty scan by
  PIP_HAS_FILESYSTEM
- PIHIDevice impl: requires filesystem (sysfs scan) in addition to threads
- PIPluginLoader::pluginsDirectories/findLibrary: guard PIFile/PIDir use
  by PIP_HAS_FILESYSTEM (fallback: empty list / path as-is)
2026-08-22 14:33:34 +03:00
andrey 077ac9887b refactor: rename PIP_NO_\* to PIP_HAS_\* with inverted logic
All feature flags now use positive naming (enabled by default):
- PIP_HAS_FILESYSTEM, PIP_HAS_THREADS, PIP_HAS_SOCKET
- PIP_HAS_PROCESS, PIP_HAS_DYNLIB, PIP_HAS_FFT, PIP_HAS_SERIAL

Preprocessor guards inverted:
- #ifndef PIP_NO_X → #ifdef PIP_HAS_X
- #ifdef PIP_NO_X → #ifndef PIP_HAS_X

CMake options default ON instead of OFF.
Platform blocks set flags OFF to disable features.

85 files transformed via Python script + 2 manual fixes.
2026-08-11 19:51:42 +03:00
andrey 75bab5a4b9 feat: add WebAssembly (Emscripten) build support
- Platform detection: EMSCRIPTEN/WASM macros in piplatform.h
- CMake: PIP_WASM option, auto-detect, STATIC lib, pthread flags,
  disable incompatible modules (console, usb, fftw, opencl, lua,
  http_server, http_client, mqtt_client)
- Macros: environ, SHUT_RDWR, HAS_LOCALE off, PIP_MIN_MSLEEP=10ms
- System stubs: process, signals, library, systeminfo, hidevice
- IO stubs: serial, ethernet, can, sharedmemory
- Thread: gettid() fallback via pthread_self()
- Core: locale/init adjustments, console.log routing via EM_ASM
- Fix: toDecimal precision loss, unreachable code in createPipe
2026-08-11 18:19:54 +03:00
andrey 4d8b743075 refactor: migrate MICRO_PIP to fine-grained feature flags
Replace monolithic MICRO_PIP/PIP_MICRO with granular flags:

Feature flags (CMake options + platform auto-detection):
- PIP_NO_FILESYSTEM, PIP_NO_THREADS, PIP_NO_SOCKET
- PIP_NO_PROCESS, PIP_NO_DYNLIB, PIP_NO_FFT, PIP_NO_SERIAL

Embedded optimization flag:
- PIP_EMBEDDED (auto-set for Pico SDK and FreeRTOS)
  Controls buffer sizes, time stubs, terminal fallback, init stubs

Platform blocks in CMakeLists.txt:
- Pico SDK: auto-disables FS, PROCESS, DYNLIB, FFT, SERIAL;
  conditionally disables THREADS (no FreeRTOS) and SOCKET (no LWIP)
- FreeRTOS: auto-disables FS, PROCESS, DYNLIB, FFT, SERIAL;
  conditionally disables SOCKET (no LWIP)
- Android: auto-disables PROCESS, DYNLIB, FFT

Updated 96 files across libs/, utils/, tests/, and CMakeLists.txt.
Builds verified for Linux (547 tests pass) and Pico SDK (100%).
Removed all MICRO_PIP and PIP_MICRO references (0 remaining).
2026-08-11 14:34:59 +03:00
andrey 3ea5af750e feat: add WebAssembly (Emscripten) build support
- Platform detection: EMSCRIPTEN/WASM macros in piplatform.h
- CMake: PIP_WASM option, auto-detect, STATIC lib, pthread flags,
  disable incompatible modules (console, usb, fftw, opencl, lua,
  http_server, http_client, mqtt_client)
- Macros: environ, SHUT_RDWR, HAS_LOCALE off, PIP_MIN_MSLEEP=10ms
- System stubs: process, signals, library, systeminfo, hidevice
- IO stubs: serial, ethernet, can, sharedmemory
- Thread: gettid() fallback via pthread_self()
- Core: locale/init adjustments, console.log routing via EM_ASM
- Fix: toDecimal precision loss, unreachable code in createPipe
2026-08-11 01:52:14 +03:00
andrey 4e7a5d58aa Merge branch 'master' into pico_sdk 2026-03-29 12:28:36 +03:00
andrey 15f90d9e17 Try MICRO_PIP fixes via opencode 2026-03-29 11:21:12 +03:00
andrey 9588b48105 PIVector2D - add funcs, optimize, tests, fixes, doxygen (#194)
Reviewed-on: #194
Co-authored-by: andrey.bychkov <andrey@signalmodelling.ru>
Co-committed-by: andrey.bychkov <andrey@signalmodelling.ru>
2026-02-27 23:58:44 +03:00
peri4 6f1660fd9e version 5.5.5
fix PIHIDevice enumeration for Windows
2026-02-13 18:47:33 +03:00
peri4 6c3c763934 try fix old mingw 2025-10-17 11:30:41 +03:00
andrey ce962bfb40 fix for new pip 2025-09-15 19:47:32 +03:00
peri4 dcdd7db33d version 5.2.1
fix potentially errors in PIConstChars compare methods
PIHIDevice::open() for open last device
PIVariant::toPoint() now can cast from PIMathVectord
2025-09-13 17:25:12 +03:00
peri4 3c72db2de8 add PIHIDevice 2025-09-11 21:06:30 +03:00