mirror of
https://github.com/esphome/esphome.git
synced 2024-11-24 16:08:10 +01:00
more changes
This commit is contained in:
parent
6b7e92b80f
commit
b49d6e2276
2 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue