From 9560d0813f0872a1b8dfb337922b0ab5cc4cb811 Mon Sep 17 00:00:00 2001 From: Rocky04 Date: Wed, 2 Aug 2023 15:25:08 +0200 Subject: [PATCH] Set unmounted on configuration reset --- src/device/usbd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/device/usbd.c b/src/device/usbd.c index 9429cf664..b4ca63c9c 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -965,7 +965,14 @@ static bool process_set_config(uint8_t rhport, uint8_t cfg_num) } // invoke callback - if (tud_mount_cb) tud_mount_cb(); + if (cfg_num) + { + if (tud_mount_cb) tud_mount_cb(); + } + else + { + if (tud_umount_cb) tud_umount_cb(); + } return true; }