1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

usbus/dfu: do not create alt interface if not needed

If riotboot is built with NUM_SLOTS=1, there is no reason to advertise a second slot in the bootloader

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
This commit is contained in:
Dylan Laduranty 2023-03-10 11:01:27 +01:00
parent 993e539651
commit 65475af1bb

View File

@ -152,7 +152,7 @@ static void _init(usbus_t *usbus, usbus_handler_t *handler)
/* Add string descriptor to the interface */
dfu->iface.descr = &dfu->slot0_str;
#ifdef MODULE_RIOTBOOT_USB_DFU
#if defined (MODULE_RIOTBOOT_USB_DFU) && NUM_SLOTS == 2
/* Create needed string descriptor for the alternate settings */
usbus_add_string_descriptor(usbus, &dfu->slot1_str, USB_DFU_MODE_SLOT1_NAME);