Add DFU runtime and mode "class"
With the runtime and mode portions in separate classes, a single application should only be building with one or the other enabled. In some applications both might be desired at build time. The CFG_TUD_DFU_RUNTIME_AND_MODE option creates a DFU class, which asks the application which mode to initialize to. This allows a runtime change between RT and DFU mode, by just reinitializing tusb.
This commit is contained in:
@@ -199,6 +199,18 @@ static usbd_class_driver_t const _usbd_driver[] =
|
||||
},
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_DFU_RUNTIME_AND_MODE
|
||||
{
|
||||
DRIVER_NAME("DFU-RT-MODE")
|
||||
.init = dfu_init,
|
||||
.reset = dfu_reset,
|
||||
.open = dfu_open,
|
||||
.control_xfer_cb = dfu_control_xfer_cb,
|
||||
.xfer_cb = NULL,
|
||||
.sof = NULL
|
||||
},
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_NET
|
||||
{
|
||||
DRIVER_NAME("NET")
|
||||
|
||||
Reference in New Issue
Block a user