Change "FuriHalNfc Current state" trace to only log on change of state #1272

Co-authored-by: gornekich <n.gorbadey@gmail.com>
This commit is contained in:
Gary 2022-05-26 09:00:59 -04:00 committed by GitHub
parent 0d5d4c8688
commit 533f12af15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,6 +61,7 @@ bool furi_hal_nfc_detect(FuriHalNfcDevData* nfc_data, uint32_t timeout) {
rfalLowPowerModeStop(); rfalLowPowerModeStop();
rfalNfcState state = rfalNfcGetState(); rfalNfcState state = rfalNfcGetState();
rfalNfcState state_old = 0;
if(state == RFAL_NFC_STATE_NOTINIT) { if(state == RFAL_NFC_STATE_NOTINIT) {
rfalNfcInitialize(); rfalNfcInitialize();
} }
@ -83,11 +84,14 @@ bool furi_hal_nfc_detect(FuriHalNfcDevData* nfc_data, uint32_t timeout) {
while(true) { while(true) {
rfalNfcWorker(); rfalNfcWorker();
state = rfalNfcGetState(); state = rfalNfcGetState();
if(state != state_old) {
FURI_LOG_T(TAG, "State change %d -> %d", state_old, state);
}
state_old = state;
if(state == RFAL_NFC_STATE_ACTIVATED) { if(state == RFAL_NFC_STATE_ACTIVATED) {
detected = true; detected = true;
break; break;
} }
FURI_LOG_T(TAG, "Current state %d", state);
if(state == RFAL_NFC_STATE_POLL_ACTIVATION) { if(state == RFAL_NFC_STATE_POLL_ACTIVATION) {
start = DWT->CYCCNT; start = DWT->CYCCNT;
continue; continue;