fix text error

This commit is contained in:
SoftFever
2026-08-25 21:35:43 +08:00
parent 2f9ef86e97
commit bfe5f7e63c

View File

@@ -108,8 +108,9 @@ TEST_CASE("Extruder states match the CONST_FILAMENTS hex encoding", "[TriangleSe
})); }));
// get_triangle_as_string emits the nibbles most significant first, so read the hex backwards. // get_triangle_as_string emits the nibbles most significant first, so read the hex backwards.
const std::string hex = c.hex;
std::vector<bool> bitstream; std::vector<bool> bitstream;
for (auto it = std::string(c.hex).rbegin(); it != std::string(c.hex).rend(); ++it) { for (auto it = hex.rbegin(); it != hex.rend(); ++it) {
const int nibble = *it >= 'A' ? (*it - 'A' + 10) : (*it - '0'); const int nibble = *it >= 'A' ? (*it - 'A' + 10) : (*it - '0');
for (int bit = 0; bit < 4; ++bit) for (int bit = 0; bit < 4; ++bit)
bitstream.push_back((nibble >> bit) & 1); bitstream.push_back((nibble >> bit) & 1);