Implementation of 1-Wire with added Alarm Search Functionality

Dependents:   Max32630_One_Wire_Interface

Revision:
120:200109b73e3c
Parent:
104:3f48daed532b
diff -r d184e69051ad -r 200109b73e3c Masters/DS248x/DS248x.cpp
--- a/Masters/DS248x/DS248x.cpp	Mon Aug 22 21:48:41 2016 +0000
+++ b/Masters/DS248x/DS248x.cpp	Tue Sep 06 09:25:52 2016 -0500
@@ -265,7 +265,7 @@
 OneWireMaster::CmdResult DS248x::OWReadByteSetLevel(uint8_t & recvByte, OWLevel afterLevel)
 {
     // 1-Wire Read Bytes (Case C)
-    //   S AD,0 [A] 1WRB [A] Sr AD,1 [A] [Status] A [Status] A\
+    //   S AD,0 [A] 1WRB [A] Sr AD,1 [A] [Status] A [Status] A
     //                                   \--------/
     //                     Repeat until 1WB bit has changed to 0
     //   Sr AD,0 [A] SRP [A] E1 [A] Sr AD,1 [A] DD A\ P
@@ -360,8 +360,11 @@
 
 OneWireMaster::CmdResult DS248x::readRegister(Register reg, uint8_t & buf, bool skipSetPointer) const
 {
-    CmdResult result;
-    result = sendCommand(SetReadPointerCmd, reg);
+    CmdResult result = Success;
+    if (!skipSetPointer)
+    {
+        result = sendCommand(SetReadPointerCmd, reg);
+    }
     if (result == Success)
     {
         if (m_i2c_bus.read(m_adrs, reinterpret_cast<char *>(&buf), 1) != I2C_READ_OK)