MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / encodeFm

Function encodeFm

lib/decoders/fmmfm.cc:55–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void encodeFm(std::vector<bool>& bits, unsigned& cursor, const Bytes& input)
56{
57 if (bits.size() == 0)
58 return;
59 unsigned len = bits.size() - 1;
60
61 for (uint8_t b : input)
62 {
63 for (int i = 0; i < 8; i++)
64 {
65 bool bit = b & 0x80;
66 b <<= 1;
67
68 if (cursor >= len)
69 return;
70
71 bits[cursor++] = true;
72 bits[cursor++] = bit;
73 }
74 }
75}
76
77void encodeMfm(std::vector<bool>& bits,
78 unsigned& cursor,

Callers 3

write_sectorFunction · 0.85
encodeMethod · 0.85
wrappedEncodeFmFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected