Skip to content

Commit ed4711c

Browse files
[lib_stusb]: init profiles when switching between dashboard & apps
1 parent dd57b59 commit ed4711c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib_stusb/src/usbd_ledger.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,18 @@ void USBD_LEDGER_start(void)
674674
USBD_Start(&usbd_ledger_data.usbd_handle);
675675
usbd_ledger_data.state = USBD_LEDGER_STATE_RUNNING;
676676
}
677+
else {
678+
for (int index = 0; index < usbd_ledger_data.nb_of_class; index++) {
679+
usbd_class_info_t *class_info = usbd_ledger_data.class[index];
680+
if (class_info) {
681+
if (class_info->init) {
682+
USBD_StatusTypeDef ret = ((usbd_class_init_t) PIC(class_info->init))(
683+
&usbd_ledger_data.usbd_handle, class_info->cookie);
684+
UNUSED(ret);
685+
}
686+
}
687+
}
688+
}
677689
}
678690

679691
void USB_LEDGER_stop(void)

0 commit comments

Comments
 (0)