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.
Fork of DS1820 by
Revision 16:37956dcaa5c0, committed 2017-03-23
- Comitter:
- YROY2004
- Date:
- Thu Mar 23 19:41:28 2017 +0000
- Parent:
- 15:236eb8f8e73a
- Commit message:
- Modified DS1820 librairy (3 defines removed to avoid problem with Nucleo board.
Changed in this revision
| DS1820.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/DS1820.cpp Sat Mar 11 20:35:59 2017 +0000
+++ b/DS1820.cpp Thu Mar 23 19:41:28 2017 +0000
@@ -1,15 +1,8 @@
#include "DS1820.h"
-#ifdef TARGET_STM
-//STM targets use opendrain mode since their switching between input and output is slow
- #define ONEWIRE_INPUT(pin) pin->write(1)
- #define ONEWIRE_OUTPUT(pin)
- #define ONEWIRE_INIT(pin) pin->output(); pin->mode(OpenDrain)
-#else
#define ONEWIRE_INPUT(pin) pin->input()
#define ONEWIRE_OUTPUT(pin) pin->output()
#define ONEWIRE_INIT(pin)
-#endif
#ifdef TARGET_NORDIC
//NORDIC targets (NRF) use software delays since their ticker uses a 32kHz clock
@@ -48,9 +41,10 @@
ONEWIRE_INIT((&_datapin));
INIT_DELAY;
- if (!unassignedProbe(&_datapin, _ROM))
- error("No unassigned DS1820 found!\n");
- else {
+ if (unassignedProbe(&_datapin, _ROM))
+// error("No unassigned DS1820 found!\n");
+// else {
+ {
_datapin.input();
probes.append(this);
_parasite_power = !read_power_supply();
