ElectronicCats / ElectronicCats-PN7150

Arduino library for I2C access to the PN7150 RFID/Near Field Communication chip
MIT License
34 stars 15 forks source link

Is there a way to use this library in a nonblocking way? #22

Closed schmidty1913 closed 1 year ago

schmidty1913 commented 3 years ago

nfc.WaitForDiscoveryNotification(&RfInterface) is a blocking function, is there a way to have it non blocking?

salmg commented 3 years ago

If you explain what you want to do, we can see if there is other way to do it. That function specifically is designed to be like that because is always looking for cards

schmidty1913 commented 3 years ago

I am looking to have the library wait for a card but also be able to loop.

I am looking to receive serial commands and also blink an LED.

salmg commented 3 years ago

what we can do is to add a parameter to the function to make it more flexible about timeout; i will add this change to the next modification, thanks

schmidty1913 commented 3 years ago

I was thinking it would be better to have a function that checks for the IRQ pin. Call that function and it returns false if the IRQ is not set and returns card data if the IRQ is set

salmg commented 3 years ago

yes please, add the functionality, and we can review it

sabas1080 commented 3 years ago

@salmg @schmidty1913

I have pullrequest with interrupt and IRQ #24

sabas1080 commented 1 year ago

Now in #46