From f3908bed9f275c3e507e49062f57f78f949cd0bb Mon Sep 17 00:00:00 2001 From: dylad Date: Tue, 15 Dec 2020 17:13:11 +0100 Subject: [PATCH] sys/auto_init: add support for USB DFU --- sys/auto_init/usb/auto_init_usb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/auto_init/usb/auto_init_usb.c b/sys/auto_init/usb/auto_init_usb.c index 176aa8819c..21ae458d73 100644 --- a/sys/auto_init/usb/auto_init_usb.c +++ b/sys/auto_init/usb/auto_init_usb.c @@ -35,6 +35,10 @@ usbus_cdcecm_device_t cdcecm; #ifdef MODULE_USBUS_CDC_ACM #include "usb/usbus/cdc/acm.h" #endif +#ifdef MODULE_USBUS_DFU +#include "usb/usbus/dfu.h" +static usbus_dfu_device_t dfu; +#endif static char _stack[USBUS_STACKSIZE]; static usbus_t usbus; @@ -58,6 +62,10 @@ void auto_init_usb(void) usbus_cdcecm_init(&usbus, &cdcecm); #endif +#ifdef MODULE_USBUS_DFU + usbus_dfu_init(&usbus, &dfu, USB_DFU_PROTOCOL_RUNTIME_MODE); +#endif + /* Finally initialize USBUS thread */ usbus_create(_stack, USBUS_STACKSIZE, USBUS_PRIO, USBUS_TNAME, &usbus); }