paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [5883] Use unsigned int for crc calculation


From: Allen Ibara
Subject: [paparazzi-commits] [5883] Use unsigned int for crc calculation
Date: Wed, 15 Sep 2010 04:59:38 +0000

Revision: 5883
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5883
Author:   aibara
Date:     2010-09-15 04:59:38 +0000 (Wed, 15 Sep 2010)
Log Message:
-----------
Use unsigned int for crc calculation

Modified Paths:
--------------
    paparazzi3/trunk/sw/airborne/fms/fms_spi_link.c

Modified: paparazzi3/trunk/sw/airborne/fms/fms_spi_link.c
===================================================================
--- paparazzi3/trunk/sw/airborne/fms/fms_spi_link.c     2010-09-15 04:58:59 UTC 
(rev 5882)
+++ paparazzi3/trunk/sw/airborne/fms/fms_spi_link.c     2010-09-15 04:59:38 UTC 
(rev 5883)
@@ -76,7 +76,7 @@
 #define TOPBIT (1 << (WIDTH - 1))
 uint8_t crc_calc_block_crc8(const uint8_t buf[], uint32_t len) {
   uint8_t  _remainder = 0;     
-  for (int byte = 0; byte < len; ++byte)  {
+  for (uint32_t byte = 0; byte < len; ++byte)  {
     _remainder ^= (buf[byte] << (WIDTH - 8));
     for (uint8_t bit = 8; bit > 0; --bit)  {
       if (_remainder & TOPBIT)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]