MCPcopy Create free account
hub / github.com/FastLED/FastLED / verifyEndBoundary

Function verifyEndBoundary

tests/fl/chipsets/encoders/lpd6803.hpp:27–46  ·  view source on GitHub ↗

Helper: Verify end boundary ((num_leds/32) DWords of 0xFF000000)

Source from the content-addressed store, hash-verified

25
26// Helper: Verify end boundary ((num_leds/32) DWords of 0xFF000000)
27static 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
49static void verifyLEDFrame(const vector<u8>& data, size_t offset, u8 r, u8 g, u8 b) {

Callers 1

lpd6803.hppFile · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected