-
Notifications
You must be signed in to change notification settings - Fork 2.1k
drivers/pn532: adapt to new i2c API #9432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers/pn532: adapt to new i2c API #9432
Conversation
Overall changes are OK but I have no sensor for testing this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise looks good, untested pre-ACK.
ret = i2c_write_bytes(dev->conf->i2c, PN532_I2C_ADDRESS, buff, len); | ||
ret = i2c_write_bytes(dev->conf->i2c, PN532_I2C_ADDRESS, buff, len, 0); | ||
if (ret == 0) { | ||
ret = len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the SPI part this might also be ret = (int)len;
, though my compiler didn't complain about assigned unsigned to signed - but might be different with other versions?!
ret = i2c_read_bytes(dev->conf->i2c, PN532_I2C_ADDRESS, buff, len + 1); | ||
ret = i2c_read_bytes(dev->conf->i2c, PN532_I2C_ADDRESS, buff, len + 1, 0); | ||
if (ret == 0) { | ||
ret = len + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito, maybe cast to int needed, see above
Tested on samr21-xpro and it seems like it is good. Ready to merge as soon as the casting and Travis issues are looked at! |
@MichelRottleuthner you can fix the remaining comments and squash directly so we can push the green button :) |
@MichelRottleuthner What's going on ? |
typo^^ just used |
is there no option to just reopen it o.O |
But I think you can reopen the PR and restore your branch using github. |
sadly no. Seems like the option was disabled because of me directly re-pushing it to the same name -.- |
Contribution description
Aapplies the new i2c API to the pn532.
Tested with adafruit PN532 RFID/NFC shield v1.3 and nucleo144-f446
Issues/PRs references
#6577