Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: OneWire.cpp
- Revision:
- 6:d6e084297fb9
- Parent:
- 5:45f3eb39b00c
- Child:
- 7:acf3f0ee66d2
diff -r 45f3eb39b00c -r d6e084297fb9 OneWire.cpp
--- 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
+