diff --git a/usb_serial/usb_serial.c b/usb_serial/usb_serial.c index 56d69fe..fe8cb67 100644 --- a/usb_serial/usb_serial.c +++ b/usb_serial/usb_serial.c @@ -167,6 +167,10 @@ void USBSerial_HandleWaitingForCommandByte(uint8_t byte) // Enter the bootloader. Wait a bit, then jump to the bootloader location. case EnterBootloader: SendByte(CommandReplyOK); + CDC_Device_Flush(&VirtualSerial_CDC_Interface); + + // Insert a small delay to ensure that it arrives before rebooting. + _delay_ms(1000); // Done with the USB interface -- the bootloader will re-initialize it. USB_Disable();