Skip to content

Commit d1944fe

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

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
@@ -655,6 +655,18 @@ void USBD_LEDGER_start(void)
655655
USBD_Start(&usbd_ledger_data.usbd_handle);
656656
usbd_ledger_data.state = USBD_LEDGER_STATE_RUNNING;
657657
}
658+
else {
659+
for (int index = 0; index < usbd_ledger_data.nb_of_class; index++) {
660+
usbd_class_info_t *class_info = usbd_ledger_data.class[index];
661+
if (class_info) {
662+
if (class_info->init) {
663+
USBD_StatusTypeDef ret = ((usbd_class_init_t) PIC(class_info->init))(
664+
&usbd_ledger_data.usbd_handle, class_info->cookie);
665+
UNUSED(ret);
666+
}
667+
}
668+
}
669+
}
658670
}
659671

660672
void USB_LEDGER_stop(void)

0 commit comments

Comments
 (0)