]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/sht11/SensirionSht11LogicP.nc
Add a BusyWait interface for controlling SHT1X timing requirements.
[tinyos-2.x.git] / tos / chips / sht11 / SensirionSht11LogicP.nc
index ce4aa6ca68f7f46bfb54696af6d250853abdb7b4..f3f02697b0737b2d783a9422d8f1ca767849ee13 100644 (file)
@@ -57,6 +57,7 @@ generic module SensirionSht11LogicP() {
   uses interface GeneralIO as CLOCK;
   uses interface GpioInterrupt as InterruptDATA;
 
+  uses interface BusyWait<TMicro, uint8_t>;
   uses interface Timer<TMilli>;
 
   uses interface Leds;
@@ -240,11 +241,17 @@ implementation {
     call DATA.makeOutput();
     call DATA.set();
     call CLOCK.clr();
+    call BusyWait.wait(5);
     call CLOCK.set();
+    call BusyWait.wait(5);
     call DATA.clr();
+    call BusyWait.wait(5);
     call CLOCK.clr();
+    call BusyWait.wait(5);
     call CLOCK.set();
+    call BusyWait.wait(5);
     call DATA.set();
+    call BusyWait.wait(5);
     call CLOCK.clr();
   }
 
@@ -261,6 +268,7 @@ implementation {
        call DATA.clr();
       byte = byte << 1;
       call CLOCK.set();
+      call BusyWait.wait(5);
       call CLOCK.clr();
     }
   }
@@ -373,6 +381,7 @@ implementation {
     call DATA.makeOutput();
     call DATA.clr();
     call CLOCK.set();
+    call BusyWait.wait(5);
     call CLOCK.clr();
     call DATA.makeInput();
     call DATA.set();
@@ -382,6 +391,7 @@ implementation {
     call DATA.makeOutput();
     call DATA.set();
     call CLOCK.set();
+    call BusyWait.wait(5);
     call CLOCK.clr();
   }