]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/mulle/softwarei2c/SoftI2CBusP.nc
pretty code, minor improvements
[tinyos-2.x.git] / tos / platforms / mulle / softwarei2c / SoftI2CBusP.nc
index 0460da4c4175b650b60060521a89aa56fc915b01..db5543b300ef81765d9b1f4395c0f23f3d8349f1 100755 (executable)
@@ -180,8 +180,14 @@ implementation
       }
 
       call I2CClk.clr();
-      if (ack) call I2C.masterAck();
-      else     call I2C.masterNack();
+      if (ack) 
+      {
+        call I2C.masterAck();
+      }
+      else
+      {
+        call I2C.masterNack();
+      }
     }
     return retChar;
   }
@@ -219,13 +225,6 @@ implementation
       transition();
       call I2CClk.clr();
 
-      // ...Check the ACK from the receiver....  
-
-      //  if(SDA2==1){ACK=0;} /* ACK received£¿*/    
-      //  else  ACK= 1;
-
-      //  SCL2 = LOW;
-      //  transition();
       idle(); 
     }
   }
@@ -234,6 +233,7 @@ implementation
   {
     atomic
     {
+      call I2CData.makeOutput();
       call I2CClk.clr();
       call I2CData.clr(); // Low for ack
       transition();
@@ -249,6 +249,7 @@ implementation
   {
     atomic 
     {
+      call I2CData.makeOutput();
       call I2CClk.clr();
 
       call I2CData.set(); // High for nack