working version

Dependencies:   mbed mbed-rtos SimpleDMA FreescaleIAP eeprom

Fork of CDMS_CODE_FM_28JAN2017 by samp Srinivasan

Revision:
353:e1803e801e20
Parent:
352:022c513aee03
Child:
354:eb6c863756a8
--- a/i2c.h	Mon Feb 06 16:36:46 2017 +0000
+++ b/i2c.h	Tue Feb 21 06:30:56 2017 +0000
@@ -139,17 +139,20 @@
 {    
    //  gPC.printf("i2C_wr\r\n");
     CDMS_I2C_GPIO = 1;
+    wait_us(1);
     write_ack = master.write(addr_bae|0x00,data,tc_len2);    
     Thread::wait(1);   //As per the tests Thread::wait is not required on master side but its safe to give 1ms
     pdirw1=PTE->PDIR;
     uint8_t i2c_count = 0;
     if(write_ack == 0)
     {
+       gPC.printf("\n\r before count loop");
         while(((pdirw1 & 0x03000000)!=0x03000000)&& i2c_count<10)
         {
             Thread::wait(1);
             pdirw1=PTE->PDIR;
             i2c_count++;
+       
         }
         if(((pdirw1 & 0x03000000)==0x03000000))
         {