diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fecmodem.cc | 14 | ||||
-rw-r--r-- | src/font.h | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/fecmodem.cc b/src/fecmodem.cc index 5323135..bd0d58c 100644 --- a/src/fecmodem.cc +++ b/src/fecmodem.cc @@ -17,14 +17,16 @@ uint8_t FECModem::correct128(uint8_t *byte, uint8_t err) uint8_t result = pgm_read_byte(&hammingParityCheck[err & 0x0f]); if (result != NO_ERROR) { - if (result == UNCORRECTABLE || byte == NULL) { + if (byte == NULL) return 3; - } else { - if (result != ERROR_IN_PARITY) { - *byte ^= result; - } - return 1; + if (result == UNCORRECTABLE) { + *byte = 0; + return 3; + } + if (result != ERROR_IN_PARITY) { + *byte ^= result; } + return 1; } return 0; } @@ -133,7 +133,7 @@ const unsigned char PROGMEM chr_125[] = {0x03,0x41,0x36,0x08}; // } const unsigned char PROGMEM chr_126[] = {0x05,0x08,0x10,0x08,0x04,0x08}; // ~ const glyph_t font[] PROGMEM = { - chr_001, + chr_002, // special character for uncorrectable byte errors chr_001, chr_002, chr_003, |