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; bool crcOK = false;
crc = 0; crc = 0;

View File

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

View File

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