From d5347ced4e15e20c70795e53a46669de88edc373 Mon Sep 17 00:00:00 2001 From: tharexde Date: Sun, 6 Dec 2020 01:48:41 +0100 Subject: [PATCH] filename in spiffs is now a parameter of em4x50_sim --- armsrc/appmain.c | 8 +++++++- armsrc/em4x50.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 186f5a654..d4893359a 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1123,7 +1123,13 @@ static void PacketReceived(PacketCommandNG *packet) { break; } case CMD_LF_EM4X50_SIM: { - em4x50_sim(); + //----------------------------------------------------------------------------- + // Note: we call FpgaDownloadAndGo(FPGA_BITSTREAM_LF) here although FPGA is not + // involved in dealing with emulator memory. But if it is called later, it might + // destroy the Emulator Memory. + //----------------------------------------------------------------------------- + FpgaDownloadAndGo(FPGA_BITSTREAM_LF); + em4x50_sim((uint8_t *)packet->data.asBytes); break; } case CMD_LF_EM4X50_READER: { diff --git a/armsrc/em4x50.h b/armsrc/em4x50.h index 33c18e794..12f0a64d8 100644 --- a/armsrc/em4x50.h +++ b/armsrc/em4x50.h @@ -24,7 +24,7 @@ void em4x50_writepwd(em4x50_data_t *etd); void em4x50_read(em4x50_data_t *etd); void em4x50_brute(em4x50_data_t *etd); void em4x50_login(uint32_t *password); -void em4x50_sim(void); +void em4x50_sim(uint8_t *filename); void em4x50_reader(void); void em4x50_chk(uint8_t *filename);