mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-14 15:54:47 +00:00
24 lines
367 B
C++
24 lines
367 B
C++
#ifndef _CRC16_h
|
|
#define _CRC16_h
|
|
|
|
#if defined(ARDUINO) && ARDUINO >= 100
|
|
#include "Arduino.h"
|
|
#else
|
|
#include "WProgram.h"
|
|
#endif
|
|
|
|
class Crc16Class
|
|
{
|
|
public:
|
|
Crc16Class();
|
|
unsigned short ComputeChecksum(byte *data, int start, int length);
|
|
protected:
|
|
private:
|
|
const unsigned short polynomial = 0x8408;
|
|
unsigned short table[256];
|
|
};
|
|
|
|
#endif
|
|
|
|
|