Browse Source

AP_Math: stop using Progmem.h

mission-4.1.18
Lucas De Marchi 9 years ago
parent
commit
502077d763
  1. 9
      libraries/AP_Math/edc.cpp
  2. 9
      libraries/AP_Math/edc.h

9
libraries/AP_Math/edc.cpp

@ -9,10 +9,9 @@ @@ -9,10 +9,9 @@
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/
#include "edc.h"
#include <AP_Progmem/AP_Progmem.h>
#include <inttypes.h>
/* CRC16 implementation acording to CCITT standards */
static const uint16_t crc16tab[256] = {
@ -52,7 +51,7 @@ static const uint16_t crc16tab[256] = { @@ -52,7 +51,7 @@ static const uint16_t crc16tab[256] = {
uint16_t crc16_ccitt(const uint8_t *buf, uint32_t len, uint16_t crc)
{
for (uint32_t i = 0; i < len; i++)
crc = (crc << 8) ^ (uint16_t) pgm_read_word(&crc16tab[((crc >> 8) ^ *buf++) & 0x00FF]);
return crc;
for (uint32_t i = 0; i < len; i++)
crc = (crc << 8) ^ crc16tab[((crc >> 8) ^ *buf++) & 0x00FF];
return crc;
}

9
libraries/AP_Math/edc.h

@ -16,13 +16,8 @@ @@ -16,13 +16,8 @@
// Copyright (C) 2010 Swift Navigation Inc.
// Contact: Fergus Noble <fergus@swift-nav.com>
#ifndef __EDC_H_
#define __EDC_H_
#pragma once
#include <stdint.h>
#include <inttypes.h>
uint16_t crc16_ccitt(const uint8_t *buf, uint32_t len, uint16_t crc);
#endif /* __EDC_H_ */

Loading…
Cancel
Save