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
+2 -2
View File
@@ -18,7 +18,7 @@
*/
#include "pikbdlistener.h"
#ifndef MICRO_PIP
#ifndef PIP_NO_THREADS
# include "piincludes_p.h"
# include "piliterals.h"
@@ -590,4 +590,4 @@ void PIKbdListener::setActive(bool yes) {
}
}
#endif // MICRO_PIP
#endif // PIP_NO_THREADS
+8 -8
View File
@@ -27,7 +27,7 @@
#include "pibase.h"
#ifndef MICRO_PIP
#ifndef PIP_NO_THREADS
# include "pithread.h"
# include "pitime.h"
@@ -36,12 +36,12 @@
//! \~\brief
//! \~english Waits until the active listener captures the configured exit key and then stops it.
//! \~russian Ожидает, пока активный слушатель перехватит настроенную клавишу выхода, и затем останавливает его.
# define WAIT_FOR_EXIT \
while (!PIKbdListener::exiting) \
piMSleep(PIP_MIN_MSLEEP * 5); \
if (PIKbdListener::instance()) { \
if (!PIKbdListener::instance()->stopAndWait(PISystemTime::fromSeconds(1))) PIKbdListener::instance()->terminate(); \
}
# define WAIT_FOR_EXIT \
while (!PIKbdListener::exiting) \
piMSleep(PIP_MIN_MSLEEP * 5); \
if (PIKbdListener::instance()) { \
if (!PIKbdListener::instance()->stopAndWait(PISystemTime::fromSeconds(1))) PIKbdListener::instance()->terminate(); \
}
//! \~\ingroup Console
@@ -381,5 +381,5 @@ REGISTER_PIVARIANTSIMPLE(PIKbdListener::KeyEvent)
REGISTER_PIVARIANTSIMPLE(PIKbdListener::MouseEvent)
REGISTER_PIVARIANTSIMPLE(PIKbdListener::WheelEvent)
#endif // MICRO_PIP
#endif // PIP_NO_THREADS
#endif // PIKBDLISTENER_H
+5 -4
View File
@@ -34,6 +34,7 @@
//! \~\brief
//! \~english Console screen manager with tile layout, drawing, and input routing.
//! \~russian Менеджер консольного экрана с раскладкой тайлов, отрисовкой и маршрутизацией ввода.
#if !defined(PICO_SDK)
class PIP_CONSOLE_EXPORT PIScreen
: public PIThread
, public PIScreenTypes::PIScreenBase {
@@ -177,14 +178,14 @@ private:
void showCursor();
void clearScreen();
void clearScreenLower();
#ifdef WINDOWS
# ifdef WINDOWS
void getWinCurCoord();
void clearLine();
void newLine();
ushort attributes(const PIScreenTypes::Cell & c);
#else
# else
PIString formatString(const PIScreenTypes::Cell & c);
#endif
# endif
PRIVATE_DECLARATION(PIP_CONSOLE_EXPORT)
int width, height, pwidth, pheight;
int mouse_x, mouse_y;
@@ -214,6 +215,6 @@ private:
PIScreenTile root;
PIScreenTile *tile_focus, *tile_dialog;
};
#endif // !PICO_SDK
#endif // PISCREEN_H
+2
View File
@@ -24,6 +24,7 @@
#ifndef PISCREENDRAWER_H
#define PISCREENDRAWER_H
#if !defined(PICO_SDK)
#include "pip_console_export.h"
#include "piscreentypes.h"
@@ -146,4 +147,5 @@ private:
};
#endif // !PICO_SDK
#endif // PISCREENDRAWER_H
+8 -4
View File
@@ -38,6 +38,7 @@ class PIScreenDrawer;
//! \details
//! \~english Base class for all screen tiles providing layout and event handling.
//! \~russian Базовый класс для всех экранных тайлов, обеспечивающий компоновку и обработку событий.
#if !defined(PICO_SDK)
class PIP_CONSOLE_EXPORT PIScreenTile: public PIObject {
friend class PIScreen;
PIOBJECT_SUBCLASS(PIScreenTile, PIObject);
@@ -163,8 +164,10 @@ public:
bool visible;
protected:
//! \~english Returns the preferred tile size in \a w and \a h. The base implementation derives it from visible children, spacing, and margins.
//! \~russian Возвращает предпочтительный размер тайла в \a w и \a h. Базовая реализация вычисляет его по видимым дочерним тайлам, интервалам и отступам.
//! \~english Returns the preferred tile size in \a w and \a h. The base implementation derives it from visible children, spacing, and
//! margins.
//! \~russian Возвращает предпочтительный размер тайла в \a w и \a h. Базовая реализация вычисляет его по видимым дочерним тайлам,
//! интервалам и отступам.
virtual void sizeHint(int & w, int & h) const;
//! \~english Called after the tile size changes to \a w by \a h during layout.
@@ -208,7 +211,8 @@ protected:
void layout();
//! \~english Returns whether this tile should participate in automatic layout. Tiles with policy \a PIScreenTypes::Ignore are skipped.
//! \~russian Возвращает, должен ли тайл участвовать в автоматической компоновке. Тайлы с политикой \a PIScreenTypes::Ignore пропускаются.
//! \~russian Возвращает, должен ли тайл участвовать в автоматической компоновке. Тайлы с политикой \a PIScreenTypes::Ignore
//! пропускаются.
bool needLayout() { return size_policy != PIScreenTypes::Ignore; }
//! \~english Owned direct child tiles.
@@ -234,6 +238,6 @@ protected:
private:
int pw, ph;
};
#endif // !PICO_SDK
#endif // PISCREENTILE_H
+2
View File
@@ -27,6 +27,7 @@
#ifndef PISCREENTILES_H
#define PISCREENTILES_H
#if !defined(PICO_SDK)
#include "pip_console_export.h"
#include "piscreentile.h"
@@ -444,4 +445,5 @@ protected:
};
#endif // !PICO_SDK
#endif // PISCREENTILES_H
+2
View File
@@ -27,6 +27,7 @@
#ifndef PISCREENTYPES_H
#define PISCREENTYPES_H
#if !defined(PICO_SDK)
#include "pip_console_export.h"
#include "pivariant.h"
@@ -284,4 +285,5 @@ BINARY_STREAM_READ(PIScreenTypes::TileEvent) {
REGISTER_PIVARIANTSIMPLE(PIScreenTypes::TileEvent)
#endif // !PICO_SDK
#endif // PISCREENTYPES_H
+2
View File
@@ -24,6 +24,7 @@
#ifndef PITERMINAL_H
#define PITERMINAL_H
#if !defined(PICO_SDK)
#include "pikbdlistener.h"
#include "pip_console_export.h"
@@ -114,4 +115,5 @@ private:
};
#endif // !PICO_SDK
#endif // PITERMINAL_H