Helper: Verify end boundary ((num_leds/32) DWords of 0xFF000000)
| 25 | |
| 26 | // Helper: Verify end boundary ((num_leds/32) DWords of 0xFF000000) |
| 27 | static void verifyEndBoundary(const vector<u8>& data, size_t num_leds, size_t start_offset) { |
| 28 | size_t expected_dwords = num_leds / 32; |
| 29 | size_t expected_bytes = expected_dwords * 4; |
| 30 | |
| 31 | if (expected_dwords == 0) { |
| 32 | // No end boundary for < 32 LEDs |
| 33 | FL_CHECK(data.size() == start_offset); |
| 34 | return; |
| 35 | } |
| 36 | |
| 37 | FL_REQUIRE(data.size() >= start_offset + expected_bytes); |
| 38 | |
| 39 | for (size_t i = 0; i < expected_dwords; i++) { |
| 40 | size_t offset = start_offset + (i * 4); |
| 41 | FL_CHECK(data[offset + 0] == 0xFF); |
| 42 | FL_CHECK(data[offset + 1] == 0x00); |
| 43 | FL_CHECK(data[offset + 2] == 0x00); |
| 44 | FL_CHECK(data[offset + 3] == 0x00); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | // Helper: Verify 16-bit LED frame at specific offset |
| 49 | static void verifyLEDFrame(const vector<u8>& data, size_t offset, u8 r, u8 g, u8 b) { |