mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-06-28 05:09:40 +00:00
refactor working
This commit is contained in:
28
IR_Decoder.h
28
IR_Decoder.h
@ -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:
|
||||
|
Reference in New Issue
Block a user