mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-05-04 07:10:16 +00:00
Compare commits
2 Commits
d1cb167aaf
...
2db1ef7805
Author | SHA1 | Date | |
---|---|---|---|
2db1ef7805 | |||
1353ab6f75 |
@ -97,7 +97,7 @@ void IR_Decoder::_tick()
|
|||||||
}
|
}
|
||||||
gotRaw.set(&packInfo, id);
|
gotRaw.set(&packInfo, id);
|
||||||
}
|
}
|
||||||
if (isWaitingAcceptSend && millis() - acceptSendTimer > 75)
|
if (isWaitingAcceptSend && millis() - acceptSendTimer > acceptDelay)
|
||||||
{
|
{
|
||||||
encoder->sendAccept(addrAcceptSendTo, acceptCustomByte);
|
encoder->sendAccept(addrAcceptSendTo, acceptCustomByte);
|
||||||
isWaitingAcceptSend = false;
|
isWaitingAcceptSend = false;
|
||||||
|
@ -14,7 +14,7 @@ private:
|
|||||||
bool isWaitingAcceptSend;
|
bool isWaitingAcceptSend;
|
||||||
uint16_t addrAcceptSendTo;
|
uint16_t addrAcceptSendTo;
|
||||||
|
|
||||||
uint16_t acceptDelay = 75;
|
uint16_t acceptDelay = IR_ResponseDelay;
|
||||||
uint8_t acceptCustomByte;
|
uint8_t acceptCustomByte;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#define riseTimeMin (riseTime - riseTolerance)
|
#define riseTimeMin (riseTime - riseTolerance)
|
||||||
#define aroundRise(t) (riseTimeMin < t && t < riseTimeMax)
|
#define aroundRise(t) (riseTimeMin < t && t < riseTimeMax)
|
||||||
#define IR_timeout (riseTimeMax * (8 + syncBits + 1)) // us // таймаут в 8 data + 3 sync + 1
|
#define IR_timeout (riseTimeMax * (8 + syncBits + 1)) // us // таймаут в 8 data + 3 sync + 1
|
||||||
|
constexpr uint16_t IR_ResponseDelay = ((uint16_t)(((bitTime+riseTolerance) * (8 + syncBits + 1))*2.7735))/1000;
|
||||||
|
|
||||||
class IR_Encoder;
|
class IR_Encoder;
|
||||||
class IR_DecoderRaw : virtual public IR_FOX
|
class IR_DecoderRaw : virtual public IR_FOX
|
||||||
|
@ -247,6 +247,10 @@ void IR_Encoder::setDecoder_isSending()
|
|||||||
for (uint8_t i = 0; i < decodersCount; i++)
|
for (uint8_t i = 0; i < decodersCount; i++)
|
||||||
{
|
{
|
||||||
blindDecoders[i]->isPairSending ^= id;
|
blindDecoders[i]->isPairSending ^= id;
|
||||||
|
// Serial.print("setDecoder_isSending() id = ");
|
||||||
|
// Serial.print(id);
|
||||||
|
// Serial.print(" isPairSending = ");
|
||||||
|
// Serial.println(blindDecoders[i]->isPairSending);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -258,7 +262,7 @@ void IR_Encoder::rawSend(uint8_t *ptr, uint8_t len)
|
|||||||
// TODO: Обработка повторной отправки
|
// TODO: Обработка повторной отправки
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Serial.println("START");
|
||||||
setDecoder_isSending();
|
setDecoder_isSending();
|
||||||
|
|
||||||
// noInterrupts();
|
// noInterrupts();
|
||||||
@ -314,7 +318,9 @@ void IR_Encoder::_isr()
|
|||||||
// сброс счетчиков
|
// сброс счетчиков
|
||||||
// ...
|
// ...
|
||||||
isSending = false;
|
isSending = false;
|
||||||
|
Serial.println("STOP");
|
||||||
setDecoder_isSending();
|
setDecoder_isSending();
|
||||||
|
Serial.println();
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user