I2C boot loader with Blinky code Should test it with Freescale boards fingers crossed should work
Fork of I2Cboot_betav1_02 by
Diff: main.cpp
- Revision:
- 9:91fb9341d36c
- Parent:
- 8:771e674458bd
--- a/main.cpp Mon May 25 13:36:12 2015 +0000 +++ b/main.cpp Sat May 30 20:05:44 2015 +0000 @@ -100,11 +100,10 @@ I2CReceiveData(uint8_t *pui8Data, uint8_t ui8Size) { - int i; + int i,stat; char temp[ui8Size]; - - + stat = i2c.read(addr, temp, ui8Size,0); for(i=0;i<ui8Size;i++) { @@ -112,15 +111,14 @@ } - - if(i2c.read(addr, temp, ui8Size,0) == 0) + if(stat == 1) { - return (0); - } pc.printf("Recieve Error\n"); return (-1); - + } + + return 0; }