3 ms·
Hmmm, 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;
by abainbridge 2y ago
Hmmm, 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