Closed
Description
If my program commences output to the USBserial port immediately after reset the initial output is lost.
Putting a 1000ms delay at the start of my program cures the problem.
Another work-around is as follows:
#include "tusb.h"
int main() {
stdio_init_all();
adc_init();
printf("waiting for usb host");
while (!tud_cdc_connected()) {
printf(".");
sleep_ms(500);
}
printf("\nusb host detected!\n");
But this too appears to be time sensitive - if I make the sleep <= 10ms I still lose the first line.
It would be nice to have a helper function that gets this right, or an option on opening the port.
Thanks.
Metadata
Metadata
Assignees
Labels
No labels