diff options
author | Attila Veghelyi <works@veghelyiattila.hu> | 2025-06-09 17:25:22 +0200 |
---|---|---|
committer | Attila Veghelyi <works@veghelyiattila.hu> | 2025-06-09 17:25:22 +0200 |
commit | a047db1259d3822b554d300ecc48fb2052bfc849 (patch) | |
tree | 87f05bec0b981ab40b24cd887d860b66cad57bd1 /op.c | |
parent | 0259dec75bd7b43b0d74fe90ad061f74b5177c86 (diff) | |
download | OpenProgrammer-a047db1259d3822b554d300ecc48fb2052bfc849.tar.gz OpenProgrammer-a047db1259d3822b554d300ecc48fb2052bfc849.zip |
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -1,6 +1,6 @@ /* * op.c - control program for the open programmer - * Copyright (C) 2009-2020 Alberto Maccioni + * Copyright (C) 2009-2025 Alberto Maccioni * for detailed info see: * http://openprog.altervista.org/ * @@ -61,6 +61,7 @@ int DeviceDetected=0; int skipV33check=0; char dev[64]=""; int devType=0x10000; +int useSAFLOCK_flag=0; int main (int argc, char **argv) { @@ -140,6 +141,7 @@ int main (int argc, char **argv) { {"spispeed", required_argument, 0, 'D'}, {"support", no_argument, &support, 1}, {"use_BKosccal", no_argument, &use_BKosccal, 1}, + {"use_SAFLOCK", no_argument,&useSAFLOCK_flag, 1}, {"version", no_argument, &ver, 1}, {"v", no_argument, &ver, 1}, {"vid", required_argument, 0, 'V'}, @@ -321,7 +323,7 @@ int main (int argc, char **argv) { if(langfile) GenerateLangFile(langid,"languages.rc"); if (ver){ - printf("OP v%s\nCopyright (C) Alberto Maccioni 2009-2023\ + printf("OP v%s\nCopyright (C) Alberto Maccioni 2009-2025\ \n For detailed info see http://openprog.altervista.org/\ \nThis program is free software; you can redistribute it and/or modify it under \ the terms of the GNU General Public License as published by the Free Software \ @@ -424,12 +426,12 @@ Foundation; either version 2 of the License, or (at your option) any later versi } if(loadfile[0]){ //write - if(Load(dev,loadfile)==-1){ + if(Load(devType,loadfile)==-1){ PrintMessage(strings[S_NoCode2]); PrintMessage("\n"); exit(-1); } - if(!strncmp(dev,"AT",2)&&loadfileEE[0]) LoadEE(dev,loadfileEE); + if(!strncmp(dev,"AT",2)&&loadfileEE[0]) LoadEE(devType,loadfileEE); //force config words if(devType==PIC16){ if((!strncmp(dev,"16F1",4)||!strncmp(dev,"12F1",4))&&sizeW>0x8008){ //16F1xxx @@ -543,8 +545,8 @@ Foundation; either version 2 of the License, or (at your option) any later versi } else Read(dev,ee,r); //choose the right function - if(savefile[0]) Save(dev,savefile); - if(!strncmp(dev,"AT",2)&&savefileEE[0]) SaveEE(dev,savefileEE); + if(savefile[0]) Save(devType,savefile); + if(!strncmp(dev,"AT",2)&&savefileEE[0]) SaveEE(devType,savefileEE); } #if !defined _WIN32 && !defined __CYGWIN__ //Linux |