WIP: Introduce USB DFU code from my at91lib DFU port

This commit is contained in:
Harald Welte
2017-02-26 17:00:43 +01:00
parent aa3b867abb
commit 7ed6f3bc37
11 changed files with 1104 additions and 11 deletions

View File

@@ -52,6 +52,7 @@
#include "chip.h"
#include "USBD_HAL.h"
#include <usb/device/dfu/dfu.h>
#include <stdbool.h>
#include <stdint.h>
@@ -1161,6 +1162,12 @@ void USBD_IrqHandler(void)
else if ((status & UDP_ISR_ENDBUSRES) != 0) {
TRACE_INFO_WP("EoBRes ");
#if defined(BOARD_USB_DFU) && defined(dfu)
if (g_dfu.past_manifest)
USBDFU_SwitchToApp();
#endif
/* Flush and enable the Suspend interrupt */
UDP->UDP_ICR = UDP_ICR_WAKEUP | UDP_ICR_RXRSM | UDP_ICR_RXSUSP;
UDP->UDP_IER = UDP_IER_RXSUSP;