mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-01 18:21:39 +02:00
* renamed .ino (must be identical to parent folder name)
* build CRC over settings, only if the CRC matches settings are applied * send command 0x80 (set time was wrong) * improved crc16 routine * added statistics for received commands and send statistics (channels are not correct for now!) * receive of commands 0x01, 0x02, 0x03, 0x81 and 0x84 working
This commit is contained in:
parent
5f927ad8c5
commit
a7add69719
11 changed files with 226 additions and 123 deletions
16
tools/esp8266/crc.h
Normal file
16
tools/esp8266/crc.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef __CRC_H__
|
||||
#define __CRC_H__
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#define CRC8_INIT 0x00
|
||||
#define CRC8_POLY 0x01
|
||||
|
||||
#define CRC16_MODBUS_POLYNOM 0xA001
|
||||
#define CRC16_NRF24_POLYNOM 0x1021
|
||||
|
||||
uint8_t crc8(uint8_t buf[], uint8_t len);
|
||||
uint16_t crc16(uint8_t buf[], uint8_t len);
|
||||
uint16_t crc16nrf24(uint8_t buf[], uint16_t lenBits, uint16_t startBit = 0, uint16_t crcIn = 0xffff);
|
||||
|
||||
#endif /*__CRC_H__*/
|
Loading…
Add table
Add a link
Reference in a new issue