I do not understand why the read_buffer was doubled and why we switched from one to the other on every block read as the operations are sequential anyway :
Code: Select all
uint8_t buffer[2][512];
while(iterator++) {
if (synchronous_bulk_read(buffer[iterator % 2])) {
synchronous_usb_write(buffer[iterator % 2]);
}
}
In the same vein, I'll try moving from "16 times 1 block write ping-pong" to "multi-block synchronous writes" another day. It seems simpler, easier to maintain and yields good results for ST. Yet obviously there was a good reason to code it this way at the time, what was it please ? I noticed pingpong runs in its own thread but aren't all operations synchronous and sequential ? Thank you.