#ifndef _stub_ws28xx_h #define _stub_ws28xx_h #include #include #include enum TWS28XXType { WS2801, WS2812, WS2812B, SK6812 = WS2812B }; // Captures what the firmware pushed to the strip, so tests can inspect pixels. class CWS28XXStripe { public: std::vector> m_Pixels; unsigned m_nUpdates = 0; CWS28XXStripe (TWS28XXType, unsigned nLEDCount, unsigned = 4000000, unsigned = 0) : m_Pixels (nLEDCount, {0,0,0}) {} boolean Initialize (void) { return TRUE; } void SetLED (unsigned n, u8 r, u8 g, u8 b) { m_Pixels.at (n) = {r,g,b}; } boolean Update (void) { m_nUpdates++; return TRUE; } boolean Blackout (void) { for (auto &p : m_Pixels) p = {0,0,0}; return TRUE; } }; #endif