From 7754dfe6e52b2b9fee5b4d1106afba59e29a37ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Koek?= Date: Fri, 4 Oct 2024 15:47:23 +0100 Subject: [PATCH] its weird that it isnt working --- .../components/ebyte_lora/ebyte_lora_component.cpp | 3 +++ esphome/components/ebyte_lora/ebyte_lora_component.h | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/esphome/components/ebyte_lora/ebyte_lora_component.cpp b/esphome/components/ebyte_lora/ebyte_lora_component.cpp index a2489814bc..9333e16b09 100644 --- a/esphome/components/ebyte_lora/ebyte_lora_component.cpp +++ b/esphome/components/ebyte_lora/ebyte_lora_component.cpp @@ -291,8 +291,11 @@ void EbyteLoraComponent::setup() { #ifdef USE_BINARY_SENSOR this->should_send_ |= !this->binary_sensors_.empty(); #endif + this->pin_aux_->pin_mode(gpio::FLAG_INPUT | gpio::FLAG_PULLUP); this->pin_aux_->setup(); + this->pin_m0_->pin_mode(gpio::FLAG_OUTPUT); this->pin_m0_->setup(); + this->pin_m1_->pin_mode(gpio::FLAG_OUTPUT); this->pin_m1_->setup(); ESP_LOGD(TAG, "Setup success"); } diff --git a/esphome/components/ebyte_lora/ebyte_lora_component.h b/esphome/components/ebyte_lora/ebyte_lora_component.h index e4d31396a6..f40872ac0b 100644 --- a/esphome/components/ebyte_lora/ebyte_lora_component.h +++ b/esphome/components/ebyte_lora/ebyte_lora_component.h @@ -71,9 +71,9 @@ class EbyteLoraComponent : public PollingComponent, public uart::UARTDevice { #ifdef USE_SENSOR void set_rssi_sensor(sensor::Sensor *rssi_sensor) { rssi_sensor_ = rssi_sensor; } #endif - void set_pin_aux(InternalGPIOPin *pin_aux) { pin_aux_ = pin_aux; } - void set_pin_m0(InternalGPIOPin *pin_m0) { pin_m0_ = pin_m0; } - void set_pin_m1(InternalGPIOPin *pin_m1) { pin_m1_ = pin_m1; } + void set_pin_aux(GPIOPin *pin_aux) { pin_aux_ = pin_aux; } + void set_pin_m0(GPIOPin *pin_m0) { pin_m0_ = pin_m0; } + void set_pin_m1(GPIOPin *pin_m1) { pin_m1_ = pin_m1; } void set_addh(uint8_t addh) { expected_config_.addh = addh; } void set_addl(uint8_t addl) { expected_config_.addl = addl; } void set_air_data_rate(AirDataRate air_data_rate) { expected_config_.air_data_rate = air_data_rate; } @@ -136,9 +136,9 @@ class EbyteLoraComponent : public PollingComponent, public uart::UARTDevice { #ifdef USE_SENSOR sensor::Sensor *rssi_sensor_{nullptr}; #endif - InternalGPIOPin *pin_aux_{nullptr}; - InternalGPIOPin *pin_m0_{nullptr}; - InternalGPIOPin *pin_m1_{nullptr}; + GPIOPin *pin_aux_{nullptr}; + GPIOPin *pin_m0_{nullptr}; + GPIOPin *pin_m1_{nullptr}; }; } // namespace ebyte_lora } // namespace esphome