refactor working

This commit is contained in:
2024-02-26 11:38:35 +03:00
parent e35bf7ae23
commit 1dc702f05d
5 changed files with 128 additions and 121 deletions

View File

@ -4,11 +4,9 @@
class IR_Decoder : public IR_DecoderRaw {
public:
IR_Decoder(const uint8_t isrPin, uint16_t addr, IR_Encoder* encPair = nullptr) :
IR_DecoderRaw(isrPin, addr, encPair),
gotData(Data(&packInfo)) {
IR_Decoder(const uint8_t isrPin, uint16_t addr, IR_Encoder* encPair = nullptr) : IR_DecoderRaw(isrPin, addr, encPair) {
}
Data gotData;
void tick() {
@ -16,9 +14,9 @@ public:
if (available()) {
Serial.println("PARSING RAW DATA");
switch (packInfo.buffer[0] & IR_MASK_MSG_TYPE) {
switch (packInfo.buffer[0] >> 5 & IR_MASK_MSG_TYPE) {
case IR_MSG_DATA_NOACCEPT:
gotData.set(&packInfo);
break;
case IR_MSG_DATA_ACCEPT:
break;
@ -34,28 +32,10 @@ public:
default:
break;
}
}
}
};
// class IDataPack : protected IR_FOX {
// friend IR_Decoder;
// public: