File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -711,7 +711,16 @@ static bool process_control_request(uint8_t rhport, tusb_control_request_t const
711711 }
712712
713713 // switch to new configuration if not zero
714- if ( cfg_num ) TU_ASSERT ( process_set_config (rhport , cfg_num ) );
714+ if ( cfg_num )
715+ {
716+ TU_ASSERT ( process_set_config (rhport , cfg_num ) );
717+
718+ if ( tud_mount_cb ) tud_mount_cb ();
719+ }
720+ else
721+ {
722+ if ( tud_umount_cb ) tud_umount_cb ();
723+ }
715724 }
716725
717726 _usbd_dev .cfg_num = cfg_num ;
@@ -964,16 +973,6 @@ static bool process_set_config(uint8_t rhport, uint8_t cfg_num)
964973 TU_ASSERT (drv_id < TOTAL_DRIVER_COUNT );
965974 }
966975
967- // invoke callback
968- if (cfg_num )
969- {
970- if (tud_mount_cb ) tud_mount_cb ();
971- }
972- else
973- {
974- if (tud_umount_cb ) tud_umount_cb ();
975- }
976-
977976 return true;
978977}
979978
You can’t perform that action at this time.
0 commit comments