aboutsummaryrefslogtreecommitdiffstats
path: root/Bootloaders/MassStorage
diff options
context:
space:
mode:
Diffstat (limited to 'Bootloaders/MassStorage')
-rw-r--r--Bootloaders/MassStorage/BootloaderMassStorage.c3
-rw-r--r--Bootloaders/MassStorage/BootloaderMassStorage.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/Bootloaders/MassStorage/BootloaderMassStorage.c b/Bootloaders/MassStorage/BootloaderMassStorage.c
index 071e86bba..81a8dc424 100644
--- a/Bootloaders/MassStorage/BootloaderMassStorage.c
+++ b/Bootloaders/MassStorage/BootloaderMassStorage.c
@@ -169,6 +169,9 @@ int main(void)
USB_USBTask();
}
+ /* Wait a short time to end all USB transactions and then disconnect */
+ _delay_us(1000);
+
/* Disconnect from the host - USB interface will be reset later along with the AVR */
USB_Detach();
diff --git a/Bootloaders/MassStorage/BootloaderMassStorage.h b/Bootloaders/MassStorage/BootloaderMassStorage.h
index 30a3164ef..3241e81a4 100644
--- a/Bootloaders/MassStorage/BootloaderMassStorage.h
+++ b/Bootloaders/MassStorage/BootloaderMassStorage.h
@@ -41,6 +41,7 @@
#include <avr/wdt.h>
#include <avr/power.h>
#include <avr/interrupt.h>
+ #include <util/delay.h>
#include <string.h>
#include "Descriptors.h"