1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

sys/auto_init: add support for USB DFU

This commit is contained in:
dylad 2020-12-15 17:13:11 +01:00 committed by Dylan Laduranty
parent 9d02efb4ea
commit f3908bed9f

View File

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