mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-29 18:26:21 +02:00
* fix negative temperature (OpenDTU issue 246) * added plausibility check based on payload length * prepared project for splitting into library and end-user-esp * added donation link to index.html * deactivated disclaimer temporarily
21 lines
632 B
C++
21 lines
632 B
C++
//-----------------------------------------------------------------------------
|
|
// 2022 Ahoy, https://github.com/lumpapu/ahoy
|
|
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifndef __CRC_H__
|
|
#define __CRC_H__
|
|
|
|
#include <cstdint>
|
|
#include "Arduino.h"
|
|
|
|
#define CRC8_INIT 0x00
|
|
#define CRC8_POLY 0x01
|
|
|
|
#define CRC16_MODBUS_POLYNOM 0xA001
|
|
|
|
namespace ah {
|
|
uint8_t crc8(uint8_t buf[], uint8_t len);
|
|
uint16_t crc16(uint8_t buf[], uint8_t len, uint16_t start = 0xffff);
|
|
}
|
|
#endif /*__CRC_H__*/
|