On Wed, 14 Aug 2024 at 18:07, Felipe Moura Oliveira <[email protected]>
wrote:
> Hello all.
>
> I am porting MFRC_522 Driver to my esp32 board, during test process my
> firmware stuck in "while" and I am think about it (I was with hardware
> issue), look code below:
> When we use this driver, if we have any issue in the rfid IC our solution
> will be locked in the "while" at line 1103 and no report will be sent to
> us. This the right approach or do you think that it can be improved, at
> least with an error msg after timeout ?
>
>
I would timeout, return an error and check for it...
here ...
ret = mfrc522_init(dev);
if (ret < 0)
{
return ret;
}
and here ...
ret = mfrc522_softreset(dev);
if (ret < 0)
{
return ret;
}
Change the return types too please.
int mfrc522_softreset(FAR struct mfrc522_dev_s *dev);
int mfrc522_init(FAR struct mfrc522_dev_s *dev);
Return OK if there are no errors.