William Reynolds
/
LPC_Bootloader
Diff: ISP.cpp
- Revision:
- 5:6134277e4d57
- Parent:
- 4:8046ba0a87b5
- Child:
- 6:fab999f0e93b
--- a/ISP.cpp Fri Sep 30 09:16:45 2011 +0000 +++ b/ISP.cpp Fri Sep 30 11:52:20 2011 +0000 @@ -171,9 +171,17 @@ readBytes(buf, 3); if (strncmp(buf,str0,1) != 0 ) return 0; - readBytes(buf, 11); - for (int i=0; i<9; i++) + readBytes(buf, 12); + + int length; + for (length=0; length<12; length++) { + if (buf[length]==0x0D) + break; + } + + for (int i=0; i<length; i++) id = (id*10)+buf[i]-'0'; + //pc.printf("%d\n\r", id); int finish = IDCheck(id); pc.printf("Chip to bootload: %s\n\r", strChipType);