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).
This commit is contained in:
2026-08-11 14:34:59 +03:00
parent 87c53d45a4
commit 4d8b743075
97 changed files with 1555 additions and 914 deletions
+16
View File
@@ -379,6 +379,7 @@ public:
bool isEmpty() const { return device_modes.isEmpty(); }
#ifndef PIP_NO_THREADS
//! \~english Returns diagnostics object for device or filter "full_path_name".
//! \~russian Возвращает объект диагностики для устройства или фильтра "full_path_name".
PIDiagnostics * diagnostic(const PIString & full_path_name) const;
@@ -386,6 +387,7 @@ public:
//! \~english Returns diagnostics object associated with device or filter "dev".
//! \~russian Возвращает объект диагностики, связанный с устройством или фильтром "dev".
PIDiagnostics * diagnostic(const PIIODevice * dev) const { return diags_.value(const_cast<PIIODevice *>(dev), 0); }
#endif
//! \~english Writes "data" to device resolved by full path "full_path".
//! \~russian Записывает "data" в устройство, найденное по полному пути "full_path".
@@ -415,6 +417,7 @@ public:
//! \~russian Возвращает, работает ли общий пул устройств в режиме имитации.
static bool isFakeMode();
#ifndef PIP_NO_THREADS
class PIP_EXPORT DevicePool: public PIThread {
PIOBJECT_SUBCLASS(DevicePool, PIThread);
friend void __DevicePool_threadReadDP(void * ddp);
@@ -456,6 +459,7 @@ public:
PIMap<PIString, DeviceData *> devices;
bool fake;
};
#endif // PIP_NO_THREADS
//! \events
@@ -471,10 +475,12 @@ public:
//! \~russian Генерируется, когда фильтр "from" выдает пакет.
EVENT2(packetReceivedEvent, const PIString &, from, const PIByteArray &, data);
#ifndef PIP_NO_THREADS
//! \fn void qualityChanged(const PIIODevice * device, PIDiagnostics::Quality new_quality, PIDiagnostics::Quality old_quality)
//! \~english Emitted when diagnostics quality of "device" changes.
//! \~russian Генерируется при изменении качества диагностики устройства "device".
EVENT3(qualityChanged, const PIIODevice *, dev, PIDiagnostics::Quality, new_quality, PIDiagnostics::Quality, old_quality);
#endif
//! \}
@@ -496,7 +502,9 @@ private:
void rawReceived(PIIODevice * dev, const PIString & from, const PIByteArray & data);
void unboundExtractor(PIPacketExtractor * pe);
EVENT_HANDLER2(void, packetExtractorReceived, const uchar *, data, int, size);
#ifndef PIP_NO_THREADS
EVENT_HANDLER2(void, diagQualityChanged, PIDiagnostics::Quality, new_quality, PIDiagnostics::Quality, old_quality);
#endif
PIString devPath(const PIIODevice * d) const;
PIString devFPath(const PIIODevice * d) const;
@@ -509,6 +517,7 @@ private:
PIVector<PIIODevice *> devices;
};
#ifndef PIP_NO_THREADS
class PIP_EXPORT Sender: public PITimer {
PIOBJECT_SUBCLASS(Sender, PIObject);
@@ -521,18 +530,24 @@ private:
PISystemTime int_;
void tick(int) override;
};
#endif
PIMap<PIString, Extractor *> extractors;
#ifndef PIP_NO_THREADS
PIMap<PIString, Sender *> senders;
#endif
PIMap<PIString, PIIODevice *> device_names;
PIMap<PIIODevice *, PIIODevice::DeviceMode> device_modes;
PIMap<PIIODevice *, PIVector<PIPacketExtractor *>> bounded_extractors;
PIMap<PIIODevice *, PIVector<PIIODevice *>> channels_;
#ifndef PIP_NO_THREADS
PIMap<PIIODevice *, PIDiagnostics *> diags_;
#endif
static PIVector<PIConnection *> _connections;
};
#ifndef PIP_NO_THREADS
void __DevicePool_threadReadDP(void * ddp);
extern PIP_EXPORT PIConnection::DevicePool * __device_pool__;
@@ -544,6 +559,7 @@ public:
};
static __DevicePoolContainer__ __device_pool_container__;
#endif // PIP_NO_THREADS
#endif // PICONNECTION_H