drivers: fix bug on receive: all pn53x_transceive after an error were flagged as erroneous

This commit is contained in:
Philippe Teuwen 2011-05-05 22:26:51 +00:00
parent cad3dc652d
commit c0a38e6eb0
2 changed files with 3 additions and 1 deletions

View file

@ -354,6 +354,7 @@ acr122_receive (nfc_device_t * pnd, byte_t * pbtData, const size_t szData)
memcpy (pbtData, DRIVER_DATA (pnd)->abtRx + 2, len);
// Transmission went successful
pnd->iLastError = 0;
return len;
}

View file

@ -443,7 +443,7 @@ read:
pnd->iLastError = DEIO;
// try to interrupt current device state
pn53x_usb_ack(pnd);
return false;
return -1;
}
const byte_t pn53x_preamble[3] = { 0x00, 0x00, 0xff };
@ -521,6 +521,7 @@ read:
return -1;
}
// The PN53x command is done and we successfully received the reply
pnd->iLastError = 0;
return len;
}