From 373cd43b73f4d43129e45b9e3f949eda2540d80f Mon Sep 17 00:00:00 2001 From: DashyFox Date: Wed, 24 Apr 2024 10:35:55 +0300 Subject: [PATCH] opti --- IR_Encoder.cpp | 6 ++++-- IR_Encoder.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/IR_Encoder.cpp b/IR_Encoder.cpp index 931c443..9e1a2e7 100644 --- a/IR_Encoder.cpp +++ b/IR_Encoder.cpp @@ -13,7 +13,7 @@ std::list& IR_Encoder::get_enc_list() // определение ф IR_Encoder::IR_Encoder(uint8_t pin, uint16_t addr, IR_DecoderRaw *decPair) { - this->pin = pin; + setPin(pin); id = addr; this->decPair = decPair; signal = noSignal; @@ -255,7 +255,9 @@ void IR_Encoder::_isr() return; ir_out_virtual = !ir_out_virtual && state; - digitalWrite(pin, ir_out_virtual); + + port->ODR &= ~(mask); + port->ODR |= mask & (ir_out_virtual ? (uint16_t)0xFFFF : (uint16_t)0x0000); if (toggleCounter) diff --git a/IR_Encoder.h b/IR_Encoder.h index c5ace21..16c1904 100644 --- a/IR_Encoder.h +++ b/IR_Encoder.h @@ -11,8 +11,8 @@ class IR_Encoder : IR_FOX public: private: uint16_t id; /// @brief Адрес передатчика - uint8_t pin; public: + /// @brief Класс передатчика /// @param addr Адрес передатчика /// @param pin Вывод передатчика