mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-06-27 20:59:37 +00:00
fix multiBlind
This commit is contained in:
@ -14,20 +14,24 @@ IR_Encoder::IR_Encoder(uint16_t addr, uint8_t pin, IR_Decoder* decPair = nullptr
|
||||
this->decPair = decPair;
|
||||
signal = noSignal;
|
||||
isSending = false;
|
||||
#if disablePairDec
|
||||
if(decPair != nullptr){
|
||||
// blindDecoders = &decPair;/////////////////////////////////////////////////////////TODO:
|
||||
// decodersCount = 1;
|
||||
blindDecoders = new IR_Decoder*[1]{decPair};
|
||||
decodersCount = 1;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
void IR_Encoder::setBlindDecoders(IR_Decoder* decoders[], uint8_t count){
|
||||
#if disablePairDec
|
||||
if(blindDecoders != nullptr) delete[] blindDecoders;
|
||||
#endif
|
||||
decodersCount = count;
|
||||
blindDecoders = decoders;
|
||||
}
|
||||
|
||||
IR_Encoder::~IR_Encoder() {
|
||||
delete [] bitHigh;
|
||||
delete [] bitLow;
|
||||
// delete [] sendBuffer;
|
||||
delete [] bitHigh;
|
||||
};
|
||||
|
||||
void IR_Encoder::sendData(uint16_t addrTo, uint8_t* data, uint8_t len, bool needAccept = false) {
|
||||
@ -116,6 +120,7 @@ void IR_Encoder::setDecoder_isSending() {
|
||||
if (decodersCount) {
|
||||
for (uint8_t i = 0; i < decodersCount; i++) {
|
||||
blindDecoders[i]->isPairSending ^= id;
|
||||
digitalToggle(9); digitalToggle(9);
|
||||
}
|
||||
|
||||
}
|
||||
@ -132,7 +137,7 @@ void IR_Encoder::rawSend(uint8_t* ptr, uint8_t len) {
|
||||
sendLen = len;
|
||||
|
||||
setDecoder_isSending();
|
||||
Serial.println("^");
|
||||
|
||||
|
||||
cli();
|
||||
toggleCounter = preambToggle; // Первая генерация для первого signal
|
||||
@ -171,7 +176,6 @@ void IR_Encoder::isr() {
|
||||
// ...
|
||||
isSending = false;
|
||||
setDecoder_isSending();
|
||||
Serial.println("^^^");
|
||||
return;
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user