interplane-mv
INTERPLANE: open interoperability protocol between AI models and agent runtimes. Models express intent. Runtimes retain authority.
Brought by drakestapleton
interplane-mv / docs / external / nightdriver / 666 / harness / stubs / modern / globals.h
| 1 | // Host stub for the platform layer. Written for this harness; not NightDriverStrip code. |
| 2 | // Provides only what src/socketserver.cpp and include/socketserver.h need from "globals.h". |
| 3 | #pragma once |
| 4 | #include <cstdint> |
| 5 | #include <cstddef> |
| 6 | #include <cstdio> |
| 7 | #include <cstdarg> |
| 8 | #include <memory> |
| 9 | #include <mutex> |
| 10 | #include <unistd.h> |
| 11 | |
| 12 | #ifndef ENABLE_AUDIO |
| 13 | #define ENABLE_AUDIO 0 |
| 14 | #endif |
| 15 | #define INCOMING_WIFI_ENABLED 1 |
| 16 | #define USE_PSRAM 0 |
| 17 | #ifndef NUM_LEDS |
| 18 | #define NUM_LEDS 144 |
| 19 | #endif |
| 20 | #define NUM_BANDS 16 |
| 21 | #define FLASH_VERSION 1 |
| 22 | #define WIFI_COMMAND_PIXELDATA64 3 |
| 23 | #define WIFI_COMMAND_PEAKDATA 4 |
| 24 | |
| 25 | struct CRGB { uint8_t r, g, b; }; |
| 26 | |
| 27 | template <typename T> using allocated_unique_ptr = std::unique_ptr<T>; |
| 28 | template <typename T> std::unique_ptr<T> make_unique_psram(size_t n) { return std::unique_ptr<T>(new typename std::remove_extent<T>::type[n]()); } |
| 29 | template <typename T> std::unique_ptr<T> make_unique_internal(size_t n) { return make_unique_psram<T>(n); } |
| 30 | |
| 31 | extern int g_debugLevel; // 0 quiet, 1 errors, 2 verbose |
| 32 | void host_log(int level, const char* tag, const char* fmt, ...) __attribute__((format(printf, 3, 4))); |
| 33 | #define debugV(...) host_log(2, "V", __VA_ARGS__) |
| 34 | #define debugI(...) host_log(1, "I", __VA_ARGS__) |
| 35 | #define debugW(...) host_log(1, "W", __VA_ARGS__) |
| 36 | #define debugE(...) host_log(1, "E", __VA_ARGS__) |
| 37 | inline void delay(unsigned ms) { usleep(ms * 1000u); } |