Mifare Classic emulation fixes (#1566)

* Add fix for field
* More small bugfixes
* Clean up
This commit is contained in:
Astra
2022-08-09 18:45:52 +03:00
committed by GitHub
parent ca23d0c207
commit 01eb92db06
2 changed files with 20 additions and 5 deletions

View File

@@ -341,13 +341,13 @@ void furi_hal_nfc_listen_start(FuriHalNfcDevData* nfc_data) {
if(nfc_data->uid_len == 4) {
pt_memory[12] = nfc_data->sak & ~FURI_HAL_NFC_UID_INCOMPLETE;
} else {
pt_memory[12] = nfc_data->sak | FURI_HAL_NFC_UID_INCOMPLETE;
pt_memory[12] = FURI_HAL_NFC_UID_INCOMPLETE;
}
pt_memory[13] = nfc_data->sak & ~FURI_HAL_NFC_UID_INCOMPLETE;
pt_memory[14] = nfc_data->sak & ~FURI_HAL_NFC_UID_INCOMPLETE;
st25r3916WritePTMem(pt_memory, sizeof(pt_memory));
// Go to sence
// Go to sense
st25r3916ExecuteCommand(ST25R3916_CMD_GOTO_SENSE);
}
@@ -507,6 +507,9 @@ static bool furi_hal_nfc_transparent_tx_rx(FuriHalNfcTxRxContext* tx_rx, uint16_
uint8_t rxe = 0;
uint32_t start = DWT->CYCCNT;
while(true) {
if(!rfalIsExtFieldOn()) {
return false;
}
if(furi_hal_gpio_read(&gpio_nfc_irq_rfid_pull) == true) {
st25r3916ReadRegister(ST25R3916_REG_IRQ_MAIN, &rxe);
if(rxe & (1 << 4)) {