Working versione for L-tek FF1705

Dependents:   DS1820

Revision:
6:d6e084297fb9
Parent:
5:45f3eb39b00c
Child:
7:acf3f0ee66d2
--- a/OneWire.cpp	Sat Jan 07 11:20:08 2017 +0000
+++ b/OneWire.cpp	Sun Jan 20 10:10:20 2019 +0000
@@ -185,10 +185,12 @@
 
     wire.output();
     wire = 0;
-    //wait_us(1);
+    timer.start();
     wire.input();
-    wait_us(5);
+    wait_us(12 - timer.read_us());
     r = wire.read();
+    timer.stop();
+    timer.reset();
     wait_us(54);
     return r;
 }
@@ -451,3 +453,4 @@
     return crc;
 }
 #endif
+