From b49d6e2276304a2a1119d79e5065f37f32caf96f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Koek?= Date: Mon, 25 Mar 2024 15:01:51 +0000 Subject: [PATCH] more changes --- esphome/components/lora/lora.cpp | 4 ++-- esphome/components/lora/lora.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/esphome/components/lora/lora.cpp b/esphome/components/lora/lora.cpp index 6b4e91b173..01cf0926e6 100644 --- a/esphome/components/lora/lora.cpp +++ b/esphome/components/lora/lora.cpp @@ -36,7 +36,7 @@ void Lora::setup() { ESP_LOGD(TAG, "Something went wrong"); } } -bool Lora::set_mode_(ModeType mode) { +bool Lora::set_mode_(ModeType type) { // data sheet claims module needs some extra time after mode setting (2ms) // most of my projects uses 10 ms, but 40ms is safer @@ -101,7 +101,7 @@ bool Lora::wait_complete_response_(uint32_t timeout, uint32_t wait_no_aux) { // if AUX pin was supplied and look for HIGH state // note you can omit using AUX if no pins are available, but you will have to use delay() to let module finish if (this->pin_aux_ != nullptr) { - while (this->pin_aux_->digital_read() == false) { + while (!this->pin_aux_->digital_read()) { if ((millis() - t) > timeout) { ESP_LOGD(TAG, "Timeout error!"); return false; diff --git a/esphome/components/lora/lora.h b/esphome/components/lora/lora.h index e5f74e357f..e4cdcaac82 100644 --- a/esphome/components/lora/lora.h +++ b/esphome/components/lora/lora.h @@ -39,7 +39,7 @@ class Lora : public PollingComponent, public uart::UARTDevice { void digital_write(uint8_t pin, bool value); /// Helper function to set the pin mode of a pin. void pin_mode(uint8_t pin, gpio::Flags flags); - void set_message_sensor(text_sensor::TextSensor *s) { message_text_sensor = s; } + void set_message_sensor(text_sensor::TextSensor *s) { message_text_sensor_ = s; } void set_rssi_sensor(sensor::Sensor *s) { rssi_sensor_ = s; } void set_pin_aux(GPIOPin *s) { pin_aux_ = s; } void set_pin_m0(GPIOPin *s) { pin_m0_ = s; } @@ -48,9 +48,9 @@ class Lora : public PollingComponent, public uart::UARTDevice { private: ModeType mode_ = MODE_0_NORMAL; // set WOR mode - bool set_mode_(ModeType type); + bool set_mode_(ModeType mode); // checks the aux port to see if it is done setting - bool wait_complete_response_(uint32_t timeout = 1000, uint32_t waitNoAux = 100); + bool wait_complete_response_(uint32_t timeout = 1000, uint32_t wait_no_aux = 100); bool send_pin_info_(uint8_t pin, bool value); protected: