altos/test: Adjust CRC error rate after FEC fix
[fw/altos] / src / kernel / ao_fec.h
index 618756c1ce7ea3984959334a7852213c1b6db462..40e5b15a082124dc7b4271fe8031b5d671d735b7 100644 (file)
@@ -3,7 +3,8 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -38,10 +39,10 @@ ao_fec_crc_byte(uint8_t byte, uint16_t crc)
 
        for (bit = 0; bit < 8; bit++) {
                if (((crc & 0x8000) >> 8) ^ (byte & 0x80))
-                       crc = (crc << 1) ^ 0x8005;
+                       crc = (uint16_t) ((crc << 1) ^ 0x8005);
                else
                        crc = (crc << 1);
-               byte <<= 1;
+               byte = (uint8_t) (byte << 1);
        }
        return crc;
 }