So, I was just trying to fill the buffer with sequential numbers 0-255. I did not think very much about this and ended up in an endless loop.
uint8_t i; uint8_t txbuf[256]; for (i=0; i<256; i++) { txbuf[i] = i; }
the problem is that i will never be 256 when it goes to zero after 255.
My question is, is there a way to make this loop without overloading i to a 16-bit value?
Note. I know that I could change the loop to i<255 and add another line for the last place, but I'm trying to figure out that there is a nicer way.
source share