4 ms·
How does the version with buf0 and buf1 work? It looks like it sends always the same two values...
by teo_zero 2y ago
How does the version with buf0 and buf1 work? It looks like it sends always the same two values...
- abainbridge 2y agoHmmm, yes. I didn't understand what the code did. Instead of creating those buff0 and buff1 variables before the loop, I should have done: for (int i = 0; i < 10; ++i) { unsigned a = i; unsigned b = i+1; msg->a = a; msg->b = b; SendWord(a); SendWord(b); } That gets rid of the load from the loop. https://godbolt.org/z/xsqWfxKzd https://godbolt.org/z/xsqWfxKzd