mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-25 23:39:37 -05:00
Manchester formatting to next largest length in nibbles.
Prior code insisted on next largest byte, for no good reason.
This commit is contained in:
parent
c657ee3558
commit
8461b0c94e
@ -586,9 +586,8 @@ static ManchesterFormatted format_manchester(
|
|||||||
const ManchesterDecoder& decoder
|
const ManchesterDecoder& decoder
|
||||||
) {
|
) {
|
||||||
const size_t payload_length_decoded = decoder.symbols_count();
|
const size_t payload_length_decoded = decoder.symbols_count();
|
||||||
const size_t payload_length_bytes = (payload_length_decoded + 7) / 8;
|
const size_t payload_length_hex_characters = (payload_length_decoded + 3) / 4;
|
||||||
const size_t payload_length_hex_characters = payload_length_bytes * 2;
|
const size_t payload_length_symbols_rounded = payload_length_hex_characters * 4;
|
||||||
const size_t payload_length_symbols_rounded = payload_length_bytes * 8;
|
|
||||||
|
|
||||||
std::string hex_data;
|
std::string hex_data;
|
||||||
std::string hex_error;
|
std::string hex_error;
|
||||||
@ -606,9 +605,9 @@ static ManchesterFormatted format_manchester(
|
|||||||
error <<= 1;
|
error <<= 1;
|
||||||
error |= symbol.error;
|
error |= symbol.error;
|
||||||
|
|
||||||
if( (i & 7) == 7 ) {
|
if( (i & 3) == 3 ) {
|
||||||
hex_data += to_string_hex(data & 0xff, 2);
|
hex_data += to_string_hex(data & 0xf, 1);
|
||||||
hex_error += to_string_hex(error & 0xff, 2);
|
hex_error += to_string_hex(error & 0xf, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user