Update ebyte_lora_component.cpp

This commit is contained in:
Daniël Koek 2024-09-27 14:33:58 +01:00
parent 9810945857
commit 37236f6d01

View file

@ -3,13 +3,13 @@ namespace esphome {
namespace ebyte_lora { namespace ebyte_lora {
void IRAM_ATTR HOT EbyteAuxStore::gpio_intr(EbyteAuxStore *arg) { void IRAM_ATTR HOT EbyteAuxStore::gpio_intr(EbyteAuxStore *arg) {
const bool can_send_ = arg->pin.digital_read(); const bool can_send = arg->pin.digital_read();
if (can_send_ == arg->can_send) if (can_send == arg->can_send)
return; return;
arg->can_send = can_send_; arg->can_send = can_send;
const uint32_t now = micros(); const uint32_t now = micros();
if (!can_send_) if (!can_send)
arg->on_time += now - arg->last_interrupt; arg->on_time += now - arg->last_interrupt;
arg->last_interrupt = now; arg->last_interrupt = now;