Added one-second delay when switching between programmer and bootloader.

Just makes me feel better to ensure the "OK" confirmation arrives at the
computer.
This commit is contained in:
Doug Brown 2012-05-19 23:07:22 -07:00
parent 7d1888dab8
commit 40cc81446a
1 changed files with 4 additions and 0 deletions

View File

@ -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();