mirror of
https://github.com/esphome/esphome.git
synced 2024-12-26 23:41:45 +01:00
Update lora.cpp
This commit is contained in:
parent
14466a4a4b
commit
56a5696df2
1 changed files with 10 additions and 10 deletions
|
@ -41,12 +41,12 @@ void Lora::setup() {
|
|||
if (this->pin_m0_ != nullptr) {
|
||||
this->pin_m0_->pin_mode(gpio::FLAG_OUTPUT);
|
||||
ESP_LOGD(TAG, "Init M0 pin!");
|
||||
this->pin_m0_->digital_write(true);
|
||||
this->pin_m0_->digital_write(HIGH);
|
||||
}
|
||||
if (this->pin_m1_ != nullptr) {
|
||||
this->pin_m1_->pin_mode(gpio::FLAG_OUTPUT);
|
||||
ESP_LOGD(TAG, "Init M1 pin!");
|
||||
this->pin_m1_->digital_write(true);
|
||||
this->pin_m1_->digital_write(HIGH);
|
||||
}
|
||||
|
||||
set_mode_(MODE_0_NORMAL);
|
||||
|
@ -95,25 +95,25 @@ void Lora::set_mode_(ModeType mode) {
|
|||
switch (mode) {
|
||||
case MODE_0_NORMAL:
|
||||
// Mode 0 | normal operation
|
||||
this->pin_m0_->digital_write(false);
|
||||
this->pin_m1_->digital_write(false);
|
||||
this->pin_m0_->digital_write(LOW);
|
||||
this->pin_m1_->digital_write(LOW);
|
||||
ESP_LOGD(TAG, "MODE NORMAL!");
|
||||
break;
|
||||
case MODE_1_WOR_TRANSMITTER:
|
||||
this->pin_m0_->digital_write(true);
|
||||
this->pin_m1_->digital_write(false);
|
||||
this->pin_m0_->digital_write(HIGH);
|
||||
this->pin_m1_->digital_write(LOW);
|
||||
ESP_LOGD(TAG, "MODE WOR!");
|
||||
break;
|
||||
case MODE_2_WOR_RECEIVER:
|
||||
// case MODE_2_PROGRAM:
|
||||
this->pin_m0_->digital_write(false);
|
||||
this->pin_m1_->digital_write(true);
|
||||
this->pin_m0_->digital_write(LOW);
|
||||
this->pin_m1_->digital_write(HIGH);
|
||||
ESP_LOGD(TAG, "MODE RECEIVING!");
|
||||
break;
|
||||
case MODE_3_CONFIGURATION:
|
||||
// Mode 3 | Setting operation
|
||||
this->pin_m0_->digital_write(true);
|
||||
this->pin_m1_->digital_write(true);
|
||||
this->pin_m0_->digital_write(HIGH);
|
||||
this->pin_m1_->digital_write(HIGH);
|
||||
ESP_LOGD(TAG, "MODE SLEEP CONFIG!");
|
||||
break;
|
||||
case MODE_INIT:
|
||||
|
|
Loading…
Reference in a new issue