fix lf sim fpga download overwrites sim buffer (#391)

* adjust LFSim to download lf fpga prior to setting emulation buffer to prevent buffer overwrite condition if you are coming from HF fpga.
* fix lf sim big buff overwrite with fpga download. Move fix to the buffer download cmd.
This commit is contained in:
marshmellow42 2017-09-11 13:18:32 -04:00 committed by pwpiwi
commit 8c8317a5e9
4 changed files with 16 additions and 8 deletions

View file

@ -251,7 +251,7 @@ int CmdLegicLoad(const char *Cmd)
fclose(f);
return -1;
}
UsbCommand c={CMD_DOWNLOADED_SIM_SAMPLES_125K, {offset, 0, 0}};
UsbCommand c={CMD_DOWNLOADED_SIM_SAMPLES_125K, {offset, 1, 0}};
int j; for(j = 0; j < 8; j++) {
c.d.asBytes[j] = data[j];
}
@ -351,7 +351,7 @@ int CmdLegicRfFill(const char *Cmd)
}
int i;
UsbCommand c={CMD_DOWNLOADED_SIM_SAMPLES_125K, {0, 0, 0}};
UsbCommand c={CMD_DOWNLOADED_SIM_SAMPLES_125K, {0, 1, 0}};
for(i = 0; i < 48; i++) {
c.d.asBytes[i] = cmd.arg[2];
}