diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-02-12 20:04:27 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-02-12 20:06:16 +0100 |
commit | 285952ea1dc6ac40d67820844033d6115ab7e404 (patch) | |
tree | 95be6de45d3af9164ca7b5bb493bbb2bc023f4ae | |
parent | e024208899abd6adb52f016c96e4c730ea2d7001 (diff) |
FECModem: set byte to 0 (frownie symbol) if it contained an uncorrectable error
-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, |