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

Function appendByte

tests/fl/channels/rx_sct_capture.cpp:53–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51// Emit one byte's worth of edge pairs (MSB first) into the buffer.
52template <fl::size N>
53void appendByte(fl::vector<EdgeTime>& edges, u8 byte) {
54 for (int bit = 7; bit >= 0; --bit) {
55 bool one = ((byte >> bit) & 0x1) != 0;
56 edges.push_back(EdgeTime(true, one ? 800u : 400u)); // HIGH
57 edges.push_back(EdgeTime(false, one ? 450u : 850u)); // LOW
58 }
59 (void)N;
60}
61
62// Wrap a `fl::vector<EdgeTime>` as a span for injectEdges().
63fl::span<const EdgeTime> toSpan(const fl::vector<EdgeTime>& v) {

Callers

nothing calls this directly

Calls 2

EdgeTimeClass · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected