Skip to content

Commit abfa580

Browse files
committed
altos: ao_fec_prepare using wrong value for input len
The FEC code always sends a multiple of four bytes, padding by two bytes for even inputs and one byte for odd. But the preparation step was using the wrong value for the length, so the output was getting mangled. Signed-off-by: Keith Packard <[email protected]>
1 parent d7a9127 commit abfa580

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/kernel/ao_fec_tx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ ao_fec_prepare(const uint8_t *in, uint8_t len, uint8_t *extra)
7474
extra[i++] = (uint8_t) crc;
7575

7676
/* Append FEC -- 1 byte if odd, two bytes if even */
77-
num_fec = 2 - (i & 1);
77+
num_fec = 2 - (len & 1);
7878
while (num_fec--)
7979
extra[i++] = AO_FEC_TRELLIS_TERMINATOR;
8080
return i;

0 commit comments

Comments
 (0)