diff options
author | Attila Veghelyi <works@veghelyiattila.hu> | 2024-06-25 20:25:31 +0200 |
---|---|---|
committer | Attila Veghelyi <works@veghelyiattila.hu> | 2024-06-25 20:25:31 +0200 |
commit | 5f686d5179d6a23a37378550b8c1122453d240c1 (patch) | |
tree | 423d6dbd1fa19a6487abb67c8da1c102ea9748b5 /progP32.c | |
parent | 2ec9ceca347f2052a0884e115a5198e5ea716262 (diff) | |
download | OpenProgrammer-5f686d5179d6a23a37378550b8c1122453d240c1.tar.gz OpenProgrammer-5f686d5179d6a23a37378550b8c1122453d240c1.zip |
Stop the process when device ID is unknownhotfix/fix-original
Diffstat (limited to 'progP32.c')
-rw-r--r-- | progP32.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -298,7 +298,7 @@ struct ID32{ {0x06201053,"PIC32MK1024MCF100"}, }; -void PIC32_ID(int id) +static bool PIC32_ID(int id) { char s[64]; int i; @@ -307,10 +307,11 @@ void PIC32_ID(int id) strcpy(s,PIC32LIST[i].device); strcat(s,"\r\n"); PrintMessage(s); - return; + return true; } } PrintMessage(strings[S_nodev]); //"Unknown device\r\n"); + return false; } /*#ifdef _MSC_VER @@ -540,7 +541,7 @@ void Read32x(int dim,int options){ for(z=0;bufferI[z]!=JTAG_XFER_DATA&&z<DIMBUF;z++); if(z<DIMBUF-4) w0=(bufferI[z+1]<<24)+(bufferI[z+2]<<16)+(bufferI[z+3]<<8)+bufferI[z+4]; PrintMessage1("IDCODE=0x%08X\r\n",w0); - PIC32_ID(w0); + if(!PIC32_ID(w0)) return; //enable serial execution mode bufferU[j++]=JTAG_SEND_CMD; bufferU[j++]=MTAP_SW_MTAP; |