pn53x_usb: try to recover device if usb read fails, solves partly Issue 122
This commit is contained in:
parent
9d1e72a9f7
commit
2fb1de34f4
1 changed files with 4 additions and 0 deletions
|
@ -327,6 +327,8 @@ pn53x_usb_transceive (nfc_device_t * pnd, const byte_t * pbtTx, const size_t szT
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
DBG ("usb_bulk_read failed with error %d", ret);
|
DBG ("usb_bulk_read failed with error %d", ret);
|
||||||
pnd->iLastError = DEIO;
|
pnd->iLastError = DEIO;
|
||||||
|
// try to interrupt current device state
|
||||||
|
pn53x_usb_ack(pnd);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -340,6 +342,8 @@ pn53x_usb_transceive (nfc_device_t * pnd, const byte_t * pbtTx, const size_t szT
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
DBG ("usb_bulk_read failed with error %d", ret);
|
DBG ("usb_bulk_read failed with error %d", ret);
|
||||||
pnd->iLastError = DEIO;
|
pnd->iLastError = DEIO;
|
||||||
|
// try to interrupt current device state
|
||||||
|
pn53x_usb_ack(pnd);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
Loading…
Add table
Reference in a new issue