enable/disable fix

This commit is contained in:
2025-01-16 17:51:21 +03:00
parent 79bb804bb4
commit b6b9d2c820
3 changed files with 6 additions and 9 deletions

View File

@ -23,12 +23,14 @@ void IR_Decoder::enable()
{
dec_list.push_back(this);
}
pinMode(pin, INPUT_PULLUP);
attachInterrupt(pin, (*this)(), CHANGE);
}
void IR_Decoder::disable()
{
detachInterrupt(pin);
pinMode(pin, INPUT);
auto &dec_list = get_dec_list();
auto it = std::find(dec_list.begin(), dec_list.end(), this);
if (it != dec_list.end())