53 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
peri4 8e41461c08 version 6.0.0_beta
PIThread:
- remove old  V singleton V, migrate to modern STATIC_INITIALIZER and common singleton
- add PowerPolicy - now implemented only for Windows, if SetThreadInformation available, then use, else try to use SetThreadIdealProcessor. Mixed cores not supported for SetThreadIdealProcessor case.

PIThreadPoolLoop: add setPriority() and setPowerPolicy()
2026-09-08 15:40:44 +03:00
andrey 14355ede0f Merge remote-tracking branch 'origin/master' into pico_sdk
# Conflicts:
#	libs/main/io_devices/pidir.cpp
#	libs/main/io_devices/pifile.cpp
#	libs/main/thread/pithread.cpp
2026-08-31 13:24:55 +03:00
andrey 446eea404f support building with musl libc (Alpine Linux)
- use LFS64 file/stat APIs only on glibc/Windows (absent in musl)
- use plain sched_priority outside glibc
- do not declare pow10(double) where the system provides C23 pow10() (musl)
- ICU is off by default: modern ICU (>= 75) needs C++17 for its headers,
  the project is built with C++11; enable explicitly with -DICU=ON
- fix latent crash: PIThread::setThreadName() read the thread handle from
  inside the new thread; the handle is not guaranteed to be visible before
  start (musl publishes it later), rename the calling thread via
  pthread_self() instead
2026-08-29 22:04:46 +00:00
andrey 7af2b0bb07 remove some ifdefs 2026-08-12 15:12:36 +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 1db0dfea43 Merge branch 'master' into pico_sdk 2026-08-11 18:21:50 +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 5e4a55cc0c fix(PIThread): remove spurious unlock() in _waitForFinish
The function called unlock() on thread_mutex without a matching
lock(), causing UB on Windows (releasing an unowned critical
section) or silently dropping a user-held lock.
2026-08-06 17:01:30 +03:00
andrey 4e7a5d58aa Merge branch 'master' into pico_sdk 2026-03-29 12:28:36 +03:00
andrey a450235743 PIP_NO_FILESYSTEM and PIP_NO_THREADS 2026-03-29 12:22:35 +03:00
andrey 96c22e1184 move std function 2026-03-20 16:31:30 +03:00
peri4 d01baffb0b PITimeMeasurer remove some API, add elapsedAndReset()
got rid off some warnings
2025-01-17 11:49:24 +03:00
peri4 82cda42e75 change last logic to PIThreadNotifier 2025-01-15 18:38:50 +03:00
peri4 5755d172cd fallback to min_sleep 2025-01-15 18:25:32 +03:00
peri4 0dd47f50a0 version 4.6.0
PIThreadNotifier::waitFor() new method
PIThread::waitForFinish() now use condvar to exit as soon as possible
2025-01-15 17:57:16 +03:00
peri4 60d2a83df5 android (maybe some other *nix) fix 2025-01-10 20:46:33 +03:00
peri4 15548de79c version 4.5.0
PIThread::stopAndWait now returns bool
PIKbdListener on Linux now use piwaitevent_p and can immediately stop
new base method piZeroMemory, also migrate all "memset 0" to piZeroMemory
2024-12-29 11:48:24 +03:00
peri4 49713ddc57 PIThread now setup itself in thread func 2024-12-29 10:50:38 +03:00
peri4 64025e0399 PIThread now wait on _endThread() when starting is really done 2024-12-26 16:01:56 +03:00
peri4 6e5556969d fix for last commit 2024-12-25 19:37:55 +03:00
peri4 b50eeaef46 fix for last commit 2024-12-25 19:34:49 +03:00
peri4 ffc471359a fix thread name for linux 2024-12-25 19:30:15 +03:00
peri4 57f8c1313e first release of translation facility
* runtime - loading and translating
 * design-time - works with *.ts file (pip_tr utility)
 * compile-time - CMake macro for compile *.ts
2024-11-05 13:49:00 +03:00
peri4 bdd18b614f PIEthernet more accuracy construct
PIThread windows fix
2024-09-17 16:11:18 +03:00
peri4 f105f616f6 PIThread more accurate end, PIEthernet tcpserver client no reinit 2024-09-17 13:22:20 +03:00
peri4 996b7ea403 important:
* PIThread::~PIThread() now unregister itself from introspection, if terminates than show warning
 * PISystemMonitor now correctly stops
 * PIPeer now can correctly stopAndWait
 * PIPeer::destroy(), protected method for close all eths and threads
 * new PIINTROSPECTION_STOP macro
 * Introspection now can be correctly stopped by macro, more safety

ClientServer:
 * ClientBase::close() stop and disconnect channel
 * Server clients clean-up now event-based
 * No warnings on client destructor
2024-09-12 17:07:48 +03:00
peri4 1c7fc39b6c version 4.0.0_alpha
in almost all methods removed timeouts in milliseconds, replaced to PISystemTime
PITimer rewrite, remove internal impl, now only thread implementation, API similar to PIThread
PITimer API no longer pass void*
PIPeer, PIConnection improved stability on reinit and exit
PISystemTime new methods
pisd now exit without hanging
2024-07-30 14:18:02 +03:00
peri4 b781bd5148 PIBroadcast fix 2024-07-10 16:56:40 +03:00
peri4 903b320629 version 3.21.0
add PISystemTime overload for thread/timer/io classes
2024-07-09 16:32:27 +03:00
peri4 ccae1a7311 more literals, use some in PIP, small refactor PIThread::start (clang-format mistakes) 2023-07-02 14:02:10 +03:00
peri4 c2b8a8d6da code format 2022-12-14 14:13:52 +03:00
peri4 c74ba871cd pivariant, enum, tiny format 2022-12-13 21:44:06 +03:00
peri4 e9128771db version 3.6.0
another fixes in PIEthernet
remove PIThread::interrupt()
piwaitevent patches
2022-11-12 13:31:26 +03:00
peri4 398d760ba9 PIObject::deleteLater important fix
PIWaitEvent::sleep() method
PITimer thread imp wait optimization, migrate to interruptable sleeps
2022-11-10 12:26:08 +03:00
Бычков Андрей d9eac06749 pithread, pitimer stop, stopAndWait 2022-11-09 17:17:21 +03:00
peri4 db5c4dcf3f PIThread::stopAndWait 2022-11-09 17:02:28 +03:00
peri4 e48d0ebaab linux signal 2022-11-01 09:38:27 +03:00
peri4 6e81a419fb start move to interruption of blocking calls, PIThread and PIEthernet 2022-11-01 00:02:44 +03:00
Бычков Андрей d13e68c206 threadedRead now const uchar *
pipacketextractor Header mode now more flexible
fix splitTime mode
more refactoring
add virtual override to functions
remove piforeach
replace 0 to nullptr
iterate over pimap via iterators
replace CONNECTU to CONNECT# with compile time check
2022-07-26 17:18:08 +03:00
peri4 39e4d9a73c doc ru 2022-04-22 21:19:12 +03:00
peri4 9deae168a6 thread doc ru 2022-04-21 22:26:49 +03:00
peri4 00830958df doc ru, printf() before assert in containers 2022-04-12 23:17:05 +03:00
peri4 54b5372356 doxygen @ tags replaced to \ 2022-03-14 21:19:31 +03:00
Andrey 8296e9a32b add FreeRTOS support for PIThread PIMutex PIConditionVariable 2022-01-21 14:15:42 +03:00
peri4 a2a205cfd2 version 2.33.0
piMinSleep() method
2021-11-16 14:43:57 +03:00
Andrey 6e5a5a6ade remove msleep, clean PIConditionVariable, rewrite pipipelinethread, etc... 2021-10-29 16:52:03 +03:00
peri4 aa76a15f40 version 2.32.0
PIObject::Connection struct
2021-10-04 21:50:49 +03:00