Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/interplane-mv/blob/main/docs/external/nightdriver/666/harness/stubs/legacy/globals.h # interplane-mv INTERPLANE: open interoperability protocol between AI models and agent runtimes. Models express intent. Runtimes retain authority. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `interplane-mv / docs / external / nightdriver / 666 / harness / stubs / legacy / globals.h` 47 lines ยท 2100 bytes Raw Blame History 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 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 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 using allocated_unique_ptr = std::unique_ptr; 28 template std::unique_ptr make_unique_psram(size_t n) { return std::unique_ptr(new typename std::remove_extent::type[n]()); } 29 template std::unique_ptr make_unique_internal(size_t n) { return make_unique_psram(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); } 38 struct HostWiFi { int RSSI() const { return -50; } }; 39 extern HostWiFi WiFi; 40 #include 41 #include 42 // Little-endian host (and the ESP32) read helpers; stand-ins for the ones in the real globals.h. 43 inline uint16_t WORDFromMemory(const uint8_t* p) { uint16_t v; std::memcpy(&v, p, sizeof v); return v; } 44 inline uint32_t DWORDFromMemory(const uint8_t* p) { uint32_t v; std::memcpy(&v, p, sizeof v); return v; } 45 inline uint64_t ULONGFromMemory(const uint8_t* p) { uint64_t v; std::memcpy(&v, p, sizeof v); return v; } 46 // Allocator stand-in: memory comes from new[] so unique_ptr::reset(ptr) can delete[] it. 47 template struct psram_allocator { T* allocate(size_t n) { return new T[n](); } };