Implementation of 1-Wire with added Alarm Search Functionality

Dependents:   Max32630_One_Wire_Interface

Revision:
79:7f22823a5a2d
Parent:
78:0cbbac7f2016
Child:
104:3f48daed532b
diff -r 0cbbac7f2016 -r 7f22823a5a2d Masters/DS2465/DS2465.cpp
--- a/Masters/DS2465/DS2465.cpp	Mon May 16 15:18:09 2016 -0500
+++ b/Masters/DS2465/DS2465.cpp	Mon May 23 18:57:12 2016 -0500
@@ -493,8 +493,6 @@
 
 OneWireMaster::CmdResult DS2465::cWriteMemory(uint8_t addr, const uint8_t * buf, size_t bufLen) const
 {
-    int i;
-
     // Write SRAM (Case A)
     //   S AD,0 [A] VSA [A] DD [A]  P
     //                      \-----/
@@ -515,7 +513,7 @@
         return OneWireMaster::CommunicationWriteError;
     }
     // loop to write each byte
-    for (i = 0; i < bufLen; i++)
+    for (int i = 0; i < bufLen; i++)
     {
         if (m_I2C_interface.write(buf[i]) != I2C_WRITE_OK)
         {
@@ -530,8 +528,6 @@
 
 OneWireMaster::CmdResult DS2465::readMemory(uint8_t addr, uint8_t * buf, size_t bufLen, bool skipSetPointer) const
 {
-    int i;
-
     // Read (Case A)
     //   S AD,0 [A] MA [A] Sr AD,1 [A] [DD] A [DD] A\ P
     //                                 \-----/
@@ -562,7 +558,7 @@
         return OneWireMaster::CommunicationWriteError;
     }
     // loop to read each byte, NAK last byte
-    for (i = 0; i < bufLen; i++)
+    for (int i = 0; i < bufLen; i++)
     {
         buf[i] = m_I2C_interface.read((i == (bufLen - 1)) ? mbed::I2C::NoACK : mbed::I2C::ACK);
     }