Commit c02b3dbb authored by Matthieu Cattin's avatar Matthieu Cattin

Fix bug for data length = 1, directly goes to last item.

parent 71ae6af7
......@@ -19,7 +19,8 @@ class C24AA64:
for i in range(len(data)-1):
#print('24AA64:write: i=%d')%(i)
self.i2c.write(data[i],False)
i += 1
if len(data) > 1:
i += 1
#print('24AA64:write:last i=%d')%(i)
self.i2c.write(data[i],True)
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment