multiBlind

This commit is contained in:
2024-02-12 18:00:21 +03:00
parent 1c79b812d3
commit bfa978394f
2 changed files with 28 additions and 19 deletions

View File

@ -21,8 +21,9 @@ public:
/// @param pin Вывод передатчика
/// @param tune Подстройка несущей частоты
/// @param decPair Приёмник, для которого отключается приём в момент передачи передатчиком
IR_Encoder(uint16_t addr, uint8_t pin, uint8_t decPairCount = 0, void* decPair = nullptr);
IR_Encoder(uint16_t addr, uint8_t pin, IR_Decoder* decPair = nullptr);
void IR_Encoder::setBlindDecoders(IR_Decoder* decoders[], uint8_t count);
template<typename T>
void sendData(uint16_t addrTo, T& data, bool needAccept = false);
void sendData(uint16_t addrTo, uint8_t* data, uint8_t len, bool needAccept = false);
@ -49,13 +50,14 @@ private:
sync = 3
};
IR_Decoder* decoders;
IR_Decoder* decPair;
IR_Decoder** blindDecoders;
uint8_t decodersCount;
uint8_t sendLen;
uint8_t sendBuffer[dataByteSizeMax] { 0 }; /// @brief Буффер данных для отправки
volatile bool isSending = false;
volatile bool isSending;
volatile bool state; /// @brief Текущий уровень генерации
volatile uint8_t dataByteCounter;