nfc: add rfal wrong state error handling (#3017)

This commit is contained in:
gornekich 2023-08-29 08:31:40 +04:00 committed by GitHub
parent cf74dd2599
commit 5eb045e25f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -701,7 +701,9 @@ bool furi_hal_nfc_tx_rx(FuriHalNfcTxRxContext* tx_rx, uint16_t timeout_ms) {
rfalNfcWorker();
state = rfalNfcGetState();
ret = rfalNfcDataExchangeGetStatus();
if(ret == ERR_BUSY) {
if(ret == ERR_WRONG_STATE) {
return false;
} else if(ret == ERR_BUSY) {
if(DWT->CYCCNT - start > timeout_ms * clocks_in_ms) {
FURI_LOG_D(TAG, "Timeout during data exchange");
return false;