add tuh_mount_cb/tuh_umount_cb

This commit is contained in:
hathach
2018-12-10 19:25:57 +07:00
parent 9c4c797502
commit 4e7596ca9c
7 changed files with 26 additions and 39 deletions

View File

@@ -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;
}