Working versione for L-tek FF1705
Revision 13:573a546ef5f9, committed 2019-03-13
- Comitter:
- marcozecchini
- Date:
- Wed Mar 13 10:05:02 2019 +0000
- Parent:
- 12:27a1b359b95c
- Commit message:
- Working for FF1705 L-tek board;
Changed in this revision
OneWire.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 27a1b359b95c -r 573a546ef5f9 OneWire.cpp --- a/OneWire.cpp Sun Mar 10 13:17:38 2019 +0000 +++ b/OneWire.cpp Wed Mar 13 10:05:02 2019 +0000 @@ -187,20 +187,21 @@ */ uint8_t OneWire::read_bit(void) { - const int SAMPLE_POINT = 10; + //const int SAMPLE_POINT = 9; // 10 works for f401re uint8_t r; - int t; + //int t; OUTPUT(); WRITE(0); - timer.start(); + //timer.start(); INPUT(); - t = timer.read_us(); - if (t < SAMPLE_POINT) - WAIT_US(SAMPLE_POINT - t); + //t = timer.read_us(); + //if (t < SAMPLE_POINT) + // WAIT_US(SAMPLE_POINT - t); + WAIT_US(1); r = READ(); - timer.stop(); - timer.reset(); + //timer.stop(); + //timer.reset(); WAIT_US(55); //printf("t = %d\r\n", t); return r;