chg: revert fpga_major mode in LF.

chg: 'lf t55xx deviceconfig'  - persistence to flashmem is now option with param P
This commit is contained in:
Chris 2018-09-23 05:29:55 +02:00
commit dc67b5d7c9
10 changed files with 117 additions and 49 deletions

View file

@ -189,7 +189,7 @@ int usage_t55xx_recoverpw(){
}
int usage_lf_deviceconfig(){
PrintAndLogEx(NORMAL, "Sets t55x7 timings for direkt commands. The timings are set here in Field Clocks (FC), \nwhich is converted to (US) on device");
PrintAndLogEx(NORMAL, "Usage: lf t55xx deviceconfig a <gap> b <gap> c <gap> d <gap> e <gap>");
PrintAndLogEx(NORMAL, "Usage: lf t55xx deviceconfig a <gap> b <gap> c <gap> d <gap> e <gap> p");
PrintAndLogEx(NORMAL, "Options:");
PrintAndLogEx(NORMAL, " h - This help");
PrintAndLogEx(NORMAL, " a <8..255> - Set start gap");
@ -197,9 +197,9 @@ int usage_lf_deviceconfig(){
PrintAndLogEx(NORMAL, " c <8..255> - Set write ZERO gap");
PrintAndLogEx(NORMAL, " d <8..255> - Set write ONE gap");
PrintAndLogEx(NORMAL, " e <8..255> - Set read gap");
PrintAndLogEx(NORMAL, " p - persist to flashmemory");
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(NORMAL, "Examples:");
PrintAndLogEx(NORMAL, " lf t55xx deviceconfig a 31 - start gap 31*8");
PrintAndLogEx(NORMAL, " lf t55xx deviceconfig a 29 b 17 c 15 d 47 e 15 - default T55XX");
PrintAndLogEx(NORMAL, " lf t55xx deviceconfig a 55 b 14 c 21 d 30 - default EM4305");
PrintAndLogEx(NORMAL, "");
@ -1903,7 +1903,7 @@ int CmdT55xxDetectPage1(const char *Cmd){
int CmdT55xxSetDeviceConfig(const char *Cmd){
uint8_t startgap = 0, writegap = 0;
uint8_t write0 = 0, write1 = 0, readgap = 0;
bool errors = false;
bool errors = false, shall_persist = false;
uint8_t cmdp = 0;
while (param_getchar(Cmd, cmdp) != 0x00 && !errors) {
switch (tolower(param_getchar(Cmd, cmdp))) {
@ -1928,7 +1928,11 @@ int CmdT55xxSetDeviceConfig(const char *Cmd){
case 'e':
errors |= param_getdec(Cmd, cmdp+1, &readgap);
cmdp += 2;
break;
break;
case 'p':
shall_persist = true;
cmdp++;
break;
default:
PrintAndLogEx(WARNING, "Unknown parameter '%c'", param_getchar(Cmd, cmdp));
errors = 1;
@ -1941,7 +1945,7 @@ int CmdT55xxSetDeviceConfig(const char *Cmd){
t55xx_config config = { startgap*8, writegap*8, write0*8, write1*8, readgap*8 };
UsbCommand c = {CMD_SET_LF_T55XX_CONFIG, {0,0,0} };
UsbCommand c = {CMD_SET_LF_T55XX_CONFIG, {shall_persist,0,0} };
memcpy(c.d.asBytes, &config, sizeof(t55xx_config));
clearCommandBuffer();
SendCommand(&c);