From 8fde0ba04745b7510ad5ea9c052af0318667007d Mon Sep 17 00:00:00 2001 From: tharexde Date: Sat, 5 Dec 2020 23:44:18 +0100 Subject: [PATCH] relocated FpgaDownloadAndGo from em4x50_chk to appmain --- armsrc/appmain.c | 6 ++++++ armsrc/em4x50.c | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index bc1b59ea2..186f5a654 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1141,6 +1141,12 @@ static void PacketReceived(PacketCommandNG *packet) { break; } case CMD_LF_EM4X50_CHK: { + //----------------------------------------------------------------------------- + // 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_chk((uint8_t *)packet->data.asBytes); break; } diff --git a/armsrc/em4x50.c b/armsrc/em4x50.c index e63d63a76..47e47e714 100644 --- a/armsrc/em4x50.c +++ b/armsrc/em4x50.c @@ -926,11 +926,6 @@ void em4x50_chk(uint8_t *filename) { uint32_t pwd = 0x0; #ifdef WITH_FLASH - //----------------------------------------------------------------------------- - // without calling FpgaDownloadAndGo the initial em4x50_chk call doesn't find - // a password (altough the correct password is in the dictionary) - //----------------------------------------------------------------------------- - FpgaDownloadAndGo(FPGA_BITSTREAM_LF); BigBuf_free();