Yea, that reset call was something I was wondering about, but I did not have the module code in front of me. I did test the for though, and it didn’t get all the characters in the small test buffer. But like I said a few bytes isn’t much in the grand scheme of things.
I would think the:
would fix this issue as it should waiting until the last write is finished. Maybe a Sleep(1) before the reset call would help?
in regular .NET here is the code I tested the buffer code with:
int arraySize = 100;
int buffer = Enumerable.Range(0, arraySize).ToArray();
int buffer2 = Enumerable.Repeat(0, arraySize).ToArray();
int block = new int;
int size = buffer.Length - buffer.Length % 32;
for (int i = 0; i < size; i += 32)
Array.Copy(buffer, i, block, 0, 32);
Array.Copy(block, 0, buffer2, i, 32);
I did throw that together, so maybe I missed something, but the buffer2 was missing the last few bytes from the first one.