mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 14:43:51 +00:00
[esp32_rmt] Set pull-up and open-drain modes based on pin schema (#8178)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
#ifdef USE_ESP32
|
||||
#include <driver/gpio.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace remote_receiver {
|
||||
@@ -62,6 +63,11 @@ void RemoteReceiverComponent::setup() {
|
||||
this->mark_failed();
|
||||
return;
|
||||
}
|
||||
if (this->pin_->get_flags() & gpio::FLAG_PULLUP) {
|
||||
gpio_pullup_en(gpio_num_t(this->pin_->get_pin()));
|
||||
} else {
|
||||
gpio_pullup_dis(gpio_num_t(this->pin_->get_pin()));
|
||||
}
|
||||
error = rmt_enable(this->channel_);
|
||||
if (error != ESP_OK) {
|
||||
this->error_code_ = error;
|
||||
|
||||
Reference in New Issue
Block a user