Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrupt causes transmission cancellation #13

Open
trogper opened this issue Apr 26, 2019 · 0 comments
Open

Interrupt causes transmission cancellation #13

trogper opened this issue Apr 26, 2019 · 0 comments
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@trogper
Copy link

trogper commented Apr 26, 2019

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);
@facchinm facchinm added the type: enhancement Proposed improvement label Apr 29, 2019
@per1234 per1234 added the topic: code Related to content of the project itself label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

3 participants