Skip to content

Interrupt causes transmission cancellation #13

@trogper

Description

@trogper

If the arduino receives an interrupt while sending, the transmission is cancelled abruptly.

I suggest continuing the sleep if the interrupt source was not interrupt_pin

I use following modification, but I won't make a PR of it since I consider it a hacky fix

void SFX_stop_sleep() {
  SFX_continue_sleep = false;
}

void SFX_continuable_sleep(uint32_t time) {
  SFX_continue_sleep = true;
  uint32_t ending = SFX_rtc.getEpoch() * 1000 + time;
  while (SFX_rtc.getEpoch() * 1000 < ending) {
    time = ending - SFX_rtc.getEpoch() * 1000;
    LowPower.sleep(time);
    if (!SFX_continue_sleep)
      return;
  }
}

and following in SIGFOXClass::send

    LowPower.attachInterruptWakeup(interrupt_pin, SFX_stop_sleep, FALLING);
    SFX_continuable_sleep(timeout);

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: enhancementProposed improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions