Modify radio_irq_handler to take a timestamp from caller.
terrillmoore opened this issue · 0 comments
At present, there's a vestigial interrupt-handling configuration option. Comments in README.md indicate that it's configurable and not tested:
Lines 187 to 189 in c3aa460
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.