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

Modify radio_irq_handler to take a timestamp from caller. #148

Closed
terrillmoore opened this issue Oct 13, 2018 · 0 comments
Closed

Modify radio_irq_handler to take a timestamp from caller. #148

terrillmoore opened this issue Oct 13, 2018 · 0 comments
Assignees
Labels

Comments

@terrillmoore
Copy link
Member

At present, there's a vestigial interrupt-handling configuration option. Comments in README.md indicate that it's configurable and not tested:

arduino-lmic/README.md

Lines 187 to 189 in c3aa460

`#define LMIC_USE_INTERRUPTS`
If defined, configures the library to use interrupts for detecting events from the transceiver. If left undefined, the library will poll for events from the transceiver. `LMIC_USE_INTERRUPTS` is not currently tested.

Commentary at https://github.com/mcci-catena/arduino-lmic#timing further discusses this, and suggests passing a timestamp from the ISR to the radio_irq_handler(). This is a really important point, especially when getting timing from the network (moving towards proper Class B support). We should do this by splitting radio_irq_handler() into two parts.

Note that in this code, the radio_irq_handler is really an event handler; the HAL is required to serialize it with any other calls into the LMIC.

void radio_irq_handler(void) {
    radio_irq_handler_v2(os_getTime());
}

void radio_irq_handler_v2(ostime_t now) {
   // body of existing handler after getting time.
}

Then HALs can migrate as they want to. The overhead from the extra subroutine call for old HALs is insignificant.

@terrillmoore terrillmoore self-assigned this Oct 13, 2018
terrillmoore added a commit that referenced this issue Oct 14, 2018
Fix #148: allow interrupts to grab timestamps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant