Commit Graph
115 Commits
Author SHA1 Message Date
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 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 2605446573 refactor: rename __PIP_TYPENAME_DECLARE to PIP_REGISTER_TYPENAME, add PIP_DECLARE_TYPENAME macro
- Rename __PIP_TYPENAME_DECLARE to PIP_REGISTER_TYPENAME across all headers
- Add PIP_DECLARE_TYPENAME(name) macro for in-class type name declaration
- Replace all static const char * __pip_typename__() member functions with PIP_DECLARE_TYPENAME
2026-08-24 19:31:41 +03:00
andrey d323ebae88 fix: register type names inside feature guards and shrink embedded I/O buffers
- move __PIP_TYPENAME_DECLARE() calls inside PIP_HAS_* guards so -fno-rtti
  builds compile with arbitrary reduced flag combinations
- guard PISerial declaration by PIP_HAS_SERIAL like other feature-gated classes
- reduce threaded read buffers to 1 KiB on embedded targets (PIIODevice,
  PIPacketExtractor, PIEthernet)
2026-08-23 09:25:32 +03:00
andrey 86a1084ec1 feat: enforce no-RTTI type name registration with static_assert 2026-08-23 08:20:51 +03:00
andrey f6075307b6 style: run clang-format over all files 2026-08-22 15:52:58 +03:00
andrey 54de1da27b refactor: merge embedded CMake blocks, link unix libs by feature flags, guard grabber/pipeline headers
- merge the PICO_BOARD and PIP_FREERTOS blocks (90% duplicate) into one
  embedded block; Pico+PICO_FREERTOS now adds -DPIP_FREERTOS so
  pithread.cpp takes the FreeRTOS path instead of POSIX pthreads;
  restore set(ICU OFF)/set(LOCAL ON) for FreeRTOS/embedded targets
- auto-disable dependent flags when PIP_HAS_THREADS=OFF:
  PIP_HAS_PROCESS, PIP_HAS_SERIAL (PIProcess derives from PIThread,
  PISerial/PIIODevice use PIThread) and INTROSPECTION (walks threads)
- LIBS_MAIN: link dl only with PIP_HAS_DYNLIB, pthread/util/rt only with
  PIP_HAS_THREADS (rt was never linked on APPLE), socket on QNX_HOST only
  with PIP_HAS_SOCKET; WIN32 list untouched - arm-none-eabi has no
  libdl/libpthread/librt so Pico firmware links again
- collapse repeated 'NOT DEFINED PICO_SDK_PATH' utils checks into
  _PIP_HOST_TOOLS variable
- FindPIP.cmake: check PIP_FREERTOS instead of the never-set
  PIP_EMBEDDED CMake variable (as in master)
- drop unused set(PIP_MICRO ON) from esp-pip
- wrap PIGrabberBase/PIPipelineThread in #ifdef PIP_HAS_THREADS like
  pithread.h so 'pip.h' compiles in no-threads builds
2026-08-22 14:06:05 +03: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 fd578ea927 fix: address review issues from MICRO_PIP migration
- piconditionvar.h: remove phantom wait(lk, timeout) stubs not in real class
- pithread.h: remove duplicate #ifndef PIP_NO_THREADS guard
- piscreendrawer/tile/tiles.cpp: remove duplicate #if !defined(PICO_SDK)
- cmake/FindPIP.cmake: replace PIP_MICRO with PIP_EMBEDDED
2026-08-11 15:26:55 +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 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 31ae52623d fix(PIConditionVariable): clamp negative timeout in waitFor
When elapsed time exceeded the timeout, the remaining milliseconds
expression went negative and was implicitly converted to DWORD,
wrapping to ~0xFFFFFFFF (5 days) — effectively INFINITE.
Now clamps to 0 and returns false when time has elapsed.
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
peri4 a16f629dc5 PIThreadPoolWorker ready to use 2026-03-25 10:59:32 +03:00
peri4 5868e0ec9d work with PIThreadPoolWorker 2026-03-24 19:56:43 +03:00
peri4 3102b985d5 add new PIThreadPoolWorker - rework of PIThreadPoolExecutor 2026-03-24 14:09:41 +03:00
andrey 96c22e1184 move std function 2026-03-20 16:31:30 +03:00
andrey 4537e40832 Merge branch 'master' into pitimer_slot 2026-03-20 15:35:34 +03:00
andrey 6efe77a395 add move 2026-03-20 13:46:31 +03:00
andrey 6cfc4524f0 PITimer slot optimize 2026-03-20 13:19:55 +03:00
andrey ac415ebbb6 revert can_unlock flag 2026-03-18 08:54:06 +03:00
andrey e761625eab using recursive mutex 2026-03-17 19:14:14 +03:00
andrey 9f57f0107e remove picout 2026-03-17 18:34:48 +03:00
andrey ac877f1024 fixes 2026-03-17 18:13:23 +03:00
andrey 8ccc05ee78 simplify piprotectedvariable 2026-03-17 17:33:27 +03:00
peri4 ed13838237 merged AI doc, some new pages 2026-03-12 14:46:57 +03:00
peri4 e57719c118 version 4.7.2
PIThreadPoolLoop reworked, now threads starts on constructor and immediately run after start()
2025-06-07 10:58:11 +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 caa7880cc4 get rid of piForeach
apply some code analyzer recommendations
ICU flag now check if libicu exists
prepare for more accurate growth of containers (limited PoT, then constantly increase size)
2024-11-20 20:01:47 +03:00
peri4 c9a5ddd89f PIProtectedVariable - user now can`t mistake
PIHTTPServer improvements
2024-11-18 11:11:19 +03:00
peri4 cdde340efe add microhttpd server 2024-11-14 18:15:27 +03:00
peri4 0840d807a0 add PIReadWriteLock, PIReadLocker and PIWriteLocker 2024-11-13 13:56:16 +03:00
peri4 4655d72554 new class PISemaphore
doc for PIProtectedVariable
2024-11-12 18:50:22 +03:00
peri4 5b066cbc27 add PIProtectedVariable 2024-11-10 21:28:59 +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