This commit is contained in:
DashyFox 2024-01-26 11:23:48 +03:00
parent 469d9875c8
commit 02410cc78c
3 changed files with 16 additions and 15 deletions

View File

@ -374,7 +374,7 @@ void IR_Decoder::writeToBuffer(bool bit) {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
bool IR_Decoder::crcCheck(uint8_t len, uint16_t &crc) {
bool IR_Decoder::crcCheck(uint8_t len, crc_t &crc) {
bool crcOK = false;
crc = 0;

View File

@ -23,6 +23,7 @@
#define subBufferSize 7 //Буфер для складирования фронтов, пока их не обработают
class IR_Encoder;
class IR_Decoder : private IR_FOX {
friend IR_Encoder;

View File

@ -70,6 +70,7 @@ msg type:
/*
/////////////////////////////////////////////////////////////////////////////////////*/
typedef uint16_t crc_t;
#define bytePerPack 3 // колличество байтов в пакете
#ifndef freeFrec
@ -89,7 +90,6 @@ msg type:
#define addrBytes 2
#define msgBytes 1
#define crcBytes 2
typedef uint16_t crc_t;
#define poly1 0x31
#define poly2 0x8C
#define syncBits 3U // количество битов синхронизации
@ -111,9 +111,9 @@ typedef uint16_t crc_t;
#define bitTakts (bitActiveTakts+bitPauseTakts*2U) // Общая длительность бита в тактах
#define bitTime (bitTakts*carrierPeriod) // Общая длительность бита
const auto viewValue = bitTime;
#define tolerance 300U
class IR_FOX {
private:
bool isSending = false;