Update ebyte_lora_component.cpp

This commit is contained in:
Daniël Koek 2024-10-04 15:22:13 +01:00
parent e84a6c40fc
commit 5db5167d25

View file

@ -294,6 +294,8 @@ void EbyteLoraComponent::setup() {
this->pin_aux_->setup();
this->pin_m0_->setup();
this->pin_m1_->setup();
this->pin_m0_->digital_write(false);
this->pin_m1_->digital_write(false);
ESP_LOGD(TAG, "Setup success");
}
void EbyteLoraComponent::get_current_config_() {
@ -311,10 +313,8 @@ void EbyteLoraComponent::get_current_config_() {
}
}
ModeType EbyteLoraComponent::get_mode_() {
ModeType internal_mode = MODE_INIT;
if (!this->can_send_message_())
return internal_mode;
return MODE_INIT;
bool pin1 = this->pin_m0_->digital_read();
bool pin2 = this->pin_m1_->digital_read();
if (!pin1 && !pin2) {
@ -333,7 +333,6 @@ ModeType EbyteLoraComponent::get_mode_() {
// ESP_LOGD(TAG, "MODE Conf!");
return CONFIGURATION;
}
return internal_mode;
}
void EbyteLoraComponent::set_mode_(ModeType mode) {
if (this->pin_m0_ == nullptr || this->pin_m1_ == nullptr) {