From c9df23c1c4ac77d6a21a3ec579349451dc876655 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda Date: Thu, 14 Nov 2024 13:35:08 -0500 Subject: [PATCH] Cleanup receiver --- esphome/components/remote_receiver/remote_receiver.h | 1 - esphome/components/remote_receiver/remote_receiver_esp32.cpp | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/esphome/components/remote_receiver/remote_receiver.h b/esphome/components/remote_receiver/remote_receiver.h index d52bf2d695..b50ce995f3 100644 --- a/esphome/components/remote_receiver/remote_receiver.h +++ b/esphome/components/remote_receiver/remote_receiver.h @@ -40,7 +40,6 @@ struct RemoteReceiverComponentStore { uint32_t receive_size{0}; esp_err_t error{ESP_OK}; rmt_receive_config_t config; - rmt_channel_handle_t channel; #endif }; diff --git a/esphome/components/remote_receiver/remote_receiver_esp32.cpp b/esphome/components/remote_receiver/remote_receiver_esp32.cpp index a8dd9f357a..8a8fa324af 100644 --- a/esphome/components/remote_receiver/remote_receiver_esp32.cpp +++ b/esphome/components/remote_receiver/remote_receiver_esp32.cpp @@ -21,8 +21,8 @@ static bool IRAM_ATTR HOT rmt_callback(rmt_channel_handle_t channel, const rmt_r next_write = store->buffer_write; store->overflow = true; } - store->error = rmt_receive(store->channel, (uint8_t *) store->buffer + next_write + event_size, store->receive_size, - &store->config); + store->error = + rmt_receive(channel, (uint8_t *) store->buffer + next_write + event_size, store->receive_size, &store->config); event_buffer->num_symbols = event->num_symbols; event_buffer->received_symbols = event->received_symbols; store->buffer_write = next_write; @@ -66,7 +66,6 @@ void RemoteReceiverComponent::setup() { uint32_t max_idle_ns = 65535u * 1000; this->store_.config.signal_range_min_ns = std::min(this->filter_us_ * 1000, max_filter_ns); this->store_.config.signal_range_max_ns = std::min(this->idle_us_ * 1000, max_idle_ns); - this->store_.channel = this->channel_; this->store_.receive_size = MEM_BLOCK_SIZE * this->mem_block_num_ * sizeof(rmt_symbol_word_t); this->store_.buffer_size = std::max((event_size + this->store_.receive_size) * 2, this->buffer_size_); this->store_.buffer = new uint8_t[this->buffer_size_];