2020-05-18 10:38 AM
I'd like to make nfcPoller interrupt driven. I've tried registering a callback so that exampleRfalPollerRun() gets called on interrupts but that didn't seem to do anything. I've also tried a simple loop that does this:
ret = gpio_init();
if(ret != ERR_NONE)
goto error;
ret = spi_init();
if(ret != ERR_NONE)
goto error;
ret = interrupt_init();
if (ret != ERR_NONE)
goto error;
rfalAnalogConfigInitialize();
rfalInitialize();
rfalWakeUpModeStart(NULL);
for(;;)
{
rfalWorker();
if ( rfalWakeUpModeHasWoke() )
{
printf("Awakened\n");
rfalWakeUpModeStop();
sleep(1);
rfalWakeUpModeStart(NULL);
}
}
But I don't get the awakened message. In any event, this isn't really interrupt driven anyway since I'm just spinning in a tighter loop. I'd like to be able to poll() on the interrupt line, as is done in pltf_gpio.c:pthread_func(). If I just call my own callback in that function I don't see the wake-up interrupt, suggesting I'm either not using the API correctly or it's not working properly. I don't know how to tell which at the moment.
Is there a methodology I should be using to switch from polling to interrupt driven processing when using the rfal library? We want to handle processing only when a tag is held over the chip instead of constantly polling for available tags in order to reduce CPU overhead.
FYI, I put in a usleep(750) in the deactivate case of exampleRfalPollerRun() (only when no tag had been detected and processed) which reduced cpu usage to about 3% on idle but that seems like an ugly hack.
Solved! Go to Solution.
2020-06-09 06:36 AM
Hi,
which ST25R device are you actually using?
Looking at your code it seems you are using Linux?!
There are two problems you are somehow mixing here:
Regards, Ulysses
2020-06-09 06:36 AM
Hi,
which ST25R device are you actually using?
Looking at your code it seems you are using Linux?!
There are two problems you are somehow mixing here:
Regards, Ulysses
2020-09-14 05:51 AM
Hi,
the new version of STSW-ST25R013 is now available on st.com. It makes better usage of CPU now.
BR, Ulrich
2023-11-22 06:37 PM
Hello, did you eventually implement NFC interrupt-driven functionality?
I've recently encountered the same issue as well.