Closed acaballero closed 7 years ago
Hey @acaballero,
It's better to use the poll style API with event handlers as many library calls check for SD events internally.
Examples can be found here: https://gist.github.com/sandeepmistry/6a6dfe9021b19bfddd60
I have the same issue. I read that if the IRQ is not enabled, the flag is not cleared and so the sd_app_evt_wait returns instantly.
I tried to enable SWI2_IRQn, and I added an empty 'SWI2_IRQHandler()' (as provided in the gist example). The device is still visible, but when I try to connect to it, it crashes (no more visible, connection fails...). I don't know (yet) how to dump the crash informations.
A temporary solution for me is to NOT enable the SWI2 interrupt, and clear this flag with 'sd_nvic_ClearPendingIRQ()' (which should be done automatically when the interrupt is enabled according to the documentation).
It looks like the SWI2_IRQHandler() is not accessible / executed. Any idea ?
Hello,
I'm trying to put a BLENano board to slepp every loop iteration. These are te steps:
2: loop:
The first time sd_app_evt_wait is called, it waits until a central is connected. But then, the execution enters the inner loop and sd_app_evt_wait returns instantly.
I've read things about pending events or interrupts, bu I've not managed to get to work. I've also tried calling sd_nvic_EnableIRQ(SWI2_IRQn); with a proper empty SWI2_IRQHandler, but then sd_app_evt_wait never returns and no central can connect to the device.
Please, ¿is there something with the library I have to setup in order for this to work?
Thanks!