William Reynolds
/
LPC_Bootloader
Diff: ISP.cpp
- Revision:
- 2:9e3ee0c6536b
- Parent:
- 1:0872c208795f
- Child:
- 3:eb6d9211592d
--- a/ISP.cpp Thu Sep 29 11:32:52 2011 +0000 +++ b/ISP.cpp Thu Sep 29 15:09:50 2011 +0000 @@ -88,6 +88,7 @@ int SerialBuffered::SectorFill(int add) { char sendStr[64]; char str0[] = "0"; + char strOK[] = "OK"; char strRAM[40]; sprintf(strRAM, "W %d 1024", RAM); @@ -104,6 +105,8 @@ sprintf(sendStr, "%d", sum20); //Checksum TargetSendStringAndCR(sendStr); readBytes(buf, 4); + if (strncmp(buf,strOK,2)!=0) + pc.printf("ERROR: Line corrupted!\n\r"); sum20=0; lines=0; pc.printf("."); break; @@ -116,6 +119,8 @@ sprintf(sendStr, "%d", sum20); //Checksum TargetSendStringAndCR(sendStr); readBytes(buf, 4); + if (strncmp(buf,strOK,2)!=0) + pc.printf("ERROR: Line corrupted!\n\r"); sum20=0; lines=0; } }