summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRocky04 <[email protected]>2023-08-02 15:25:08 +0200
committerGitHub <[email protected]>2023-08-02 15:25:08 +0200
commit9560d0813f0872a1b8dfb337922b0ab5cc4cb811 (patch)
treecd522ee96893076f456abb0b6d8ecf16e5018e5c
parent5cf94234d20cf74e1d6bb952ce1680b25f2568b3 (diff)
Set unmounted on configuration reset
-rw-r--r--src/device/usbd.c9
1 files changed, 8 insertions, 1 deletions
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;
}