Why does LoRa TX not work when using GpioAssignEvent()?
|Some of the internal SmartBASIC events are being shared between certain peripherals and hence limitations apply for certain combinations. On the RM186 the SmartBASIC implementation uses the same mechanism internally to trigger both LoRa TX and GPIO assign events.
Simplest workaround would be using GpioBindEvent() instead of GpioAssignEvent(). However, this comes with a slightly higher power consumption.
Another workaround would be clearing the GPIO assign event before triggering a LoRa TX event and vice versa. To ensure this, the following sequence would be needed:
- In your GpioAssignEvent() callback function disable the assign event with GpioUnassignEvent() and start a short one-shot timer (e.g. some 10msecs).
- In the callback of that timer trigger the LoRa TX.
- On completion of the LoRa TX (either successfully or failed or both, depends on your application) re-enable the GPIO assign event in e.g. one (or more) of the following callbacks: EVLORAMACSEQUENCECOMPLETE or EVLORAMACTXCOMPLETE or EVLORAMACRXCOMPLETE (maybe others could be used too, would depend on your application)