From 4e7596ca9cdde3bd1197cf1853c370d8da48d7a2 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 10 Dec 2018 19:25:57 +0700 Subject: add tuh_mount_cb/tuh_umount_cb --- src/device/usbd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/device') diff --git a/src/device/usbd.c b/src/device/usbd.c index d1b708a0d..ad40e3c9f 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -272,7 +272,8 @@ static void usbd_task_body(void) // TODO remove since if task is too slow, we could clear the event of the new attached osal_queue_reset(_usbd_q); - tud_umount_cb(); // invoke callback + // invoke callback + if (tud_umount_cb) tud_umount_cb(); break; case DCD_EVENT_SOF: @@ -467,7 +468,7 @@ static bool process_set_config(uint8_t rhport) } // invoke callback - tud_mount_cb(); + if (tud_mount_cb) tud_mount_cb(); return TUSB_ERROR_NONE; } -- cgit v1.3.1