Skip to content

Commit

Permalink
dpcmd.c
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 15, 2021
1 parent 11e3d37 commit ccbca7d
Show file tree
Hide file tree
Showing 27 changed files with 56 additions and 11 deletions.
Empty file modified .gear/rules
100644 → 100755
Empty file.
Empty file modified .gear/sf100linux.spec
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified 60-dediprog.rules
100644 → 100755
Empty file.
21 changes: 21 additions & 0 deletions ChipInfoDb.dedicfg
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21060,6 +21060,27 @@ RDIDCommand="0x9F"/>
ProgramIOMethod="SPQD_RQWSW"
IDNumber="3"
RDIDCommand="0x9F"/>
<Chip TypeName="W25Q16JW"
ICType="SPI_NOR"
Class="W25Pxx"
UniqueID="0xEF8015"
Description="16 Mbit, Serial Flash Memory"
Manufacturer="Winbond Electronics Corp"
ManufactureUrl="www.winbond.com"
Voltage="1.8V"
Clock="75MHz"
Timeout="40"
JedecDeviceID="0xEF8015"
ManufactureID="0xEF"
DeviceID="0x14"
ChipSizeInKByte="2048"
SectorSizeInByte="4096"
PageSizeInByte="256"
BlockSizeInByte="65536"
AddrWidth="3"
ProgramIOMethod="SPSD_RSW"
IDNumber="3"
RDIDCommand="0x9F"/>
<Chip TypeName="W25Q16JV"
ICType="SPI_NOR"
Class="W25Pxx"
Expand Down
Empty file modified ChipInfoDb.h
100644 → 100755
Empty file.
Empty file modified FlashCommand.c
100644 → 100755
Empty file.
Empty file modified FlashCommand.h
100644 → 100755
Empty file.
Empty file modified IntelHexFile.c
100644 → 100755
Empty file.
Empty file modified IntelHexFile.h
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified Macro.h
100644 → 100755
Empty file.
Empty file modified Makefile
100644 → 100755
Empty file.
Empty file modified MotorolaFile.c
100644 → 100755
Empty file.
Empty file modified MotorolaFile.h
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified SerialFlash.c
100644 → 100755
Empty file.
Empty file modified SerialFlash.h
100644 → 100755
Empty file.
Empty file modified board.c
100644 → 100755
Empty file.
Empty file modified board.h
100644 → 100755
Empty file.
42 changes: 33 additions & 9 deletions dpcmd.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ int main(int argc, char* argv[])
unsigned long r;
char *env;

printf("\nDpCmd Linux 1.12.7.%02d Engine Version:\nLast Built on October 27 2021\n\n", GetConfigVer()); // 1. new feature.bug.configS
printf("\nDpCmd Linux 1.12.8.%02d Engine Version:\nLast Built on October 27 2021\n\n", GetConfigVer()); // 1. new feature.bug.configS

g_ucOperation = 0;
GetLogPath(g_LogPath);
Expand Down Expand Up @@ -576,7 +576,7 @@ int main(int argc, char* argv[])
break;
case 'r':
g_parameter_read = optarg;
g_ucOperation |= READ_TO_FILE;
g_ucOperation |= READ_TO_FILE;
break;
case 'p':
g_parameter_program = optarg;
Expand Down Expand Up @@ -1564,6 +1564,7 @@ void do_Read(void)
DownloadAddrRange.end = g_uiAddr + g_uiLen;

printf("%s\n", msg_info_reading);

Run(READ_ANY_BY_PREFERENCE_CONFIGURATION, g_uiDevNum);
Wait(msg_info_readOK, msg_info_readfail);
}
Expand All @@ -1587,14 +1588,37 @@ void do_DisplayOrSave(void)
printf("\n\n");
} else {
UploadAddrRange.length = UploadAddrRange.end - UploadAddrRange.start;
char str[64];
sprintf(str, "%d_", icnt + 1);
strcat(str, g_parameter_read);

if (WriteFile((const char*)str, pBufferForLastReadData[icnt], UploadAddrRange.length) == 1)
printf("\nSuccessfully saved into file:%s \n", str);
char SourceStr[64];


sprintf(SourceStr, "%s", g_parameter_read);



int len = strlen(SourceStr);
int i = len;
while(SourceStr[i]!='.' && i>0)
i--;
char ExtStr[64];;
if(SourceStr[i]=='.')
sprintf(ExtStr, "%s", &SourceStr[i]);
else
sprintf(ExtStr, "%s", &SourceStr[len]);

char *loc = strstr(SourceStr,ExtStr);

for(int i=loc-SourceStr;i<strlen(SourceStr);i++)
SourceStr[i]='\0';

char str[64];
sprintf(str, "_%d", icnt + 1);
strcat(SourceStr, str);
strcat(SourceStr, ExtStr);

if (WriteFile((const char*)SourceStr, pBufferForLastReadData[icnt], UploadAddrRange.length) == 1)
printf("\nSuccessfully saved into file:%s \n", SourceStr);
else
printf("\nFailed to save into file: %s\n", str);
printf("\nFailed to save into file: %s\n", SourceStr);
}
}
} else if (g_uiDevNum != 0) {
Expand Down
Empty file modified dpcmd.h
100644 → 100755
Empty file.
Empty file modified parse.c
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions project.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ bool threadEraseWholeChip(int Index)
}

bool threadReadRangeChip(struct CAddressRange range, int Index)
{
{
bool result = true;
struct CAddressRange AddrRound;

Expand Down Expand Up @@ -504,7 +504,7 @@ bool threadReadRangeChip(struct CAddressRange range, int Index)
}

bool threadReadChip(int Index)
{
{
bool result = false;
struct CAddressRange Addr;
Addr.start = 0;
Expand Down
Empty file modified project.h
100644 → 100755
Empty file.
Empty file modified usbdriver.c
100644 → 100755
Empty file.
Empty file modified usbdriver.h
100644 → 100755
Empty file.

0 comments on commit ccbca7d

Please sign in to comment.