Implementation of 1-Wire with added Alarm Search Functionality

Dependents:   Max32630_One_Wire_Interface

Revision:
120:200109b73e3c
Parent:
113:13e2865603df
Child:
139:f0e0a7976846
--- a/Slaves/Authenticators/DS28E15_22_25/DS28E15_22_25.cpp	Mon Aug 22 21:48:41 2016 +0000
+++ b/Slaves/Authenticators/DS28E15_22_25/DS28E15_22_25.cpp	Tue Sep 06 09:25:52 2016 -0500
@@ -747,7 +747,7 @@
 OneWireSlave::CmdResult DS28E15_22_25::writeAuthSegmentMac(unsigned int pageNum, unsigned int segmentNum, const Segment & newData, const Mac & mac, bool continuing)
 {
     uint8_t buf[256], cs;
-    int cnt, i, offset;
+    int cnt, offset;
 
     cnt = 0;
     offset = 0;
@@ -774,7 +774,7 @@
     }
 
     // add the data
-    for (i = 0; i < newData.length; i++)
+    for (size_t i = 0; i < newData.length; i++)
     {
         buf[cnt++] = newData[i];
     }
@@ -1047,7 +1047,7 @@
 
 OneWireSlave::CmdResult DS28E15_22_25::readSegment(unsigned int page, unsigned int segment, Segment & data, bool continuing) const
 {
-    OneWireMaster::CmdResult result;
+    OneWireMaster::CmdResult result = OneWireMaster::OperationFailure;
     uint8_t buf[2];
 
     if (!continuing)
@@ -1084,7 +1084,8 @@
 OneWireSlave::CmdResult DS28E15_22_25::writeSegment(unsigned int page, unsigned int block, const Segment & data, bool continuing)
 {
     uint8_t buf[256], cs;
-    int cnt, offset;
+    int cnt = 0;
+    int offset = 0;
 
     cnt = 0;
     offset = 0;