diff options
| author | hathach <[email protected]> | 2018-12-10 19:25:57 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-12-10 19:25:57 +0700 |
| commit | 4e7596ca9cdde3bd1197cf1853c370d8da48d7a2 (patch) | |
| tree | d17cf308413a25236417bad16d6952f440e14a73 /src/device | |
| parent | 9c4c7975024e9b971a43a866c1feffb419dd8f5b (diff) | |
add tuh_mount_cb/tuh_umount_cb
Diffstat (limited to 'src/device')
| -rw-r--r-- | src/device/usbd.c | 5 |
1 files changed, 3 insertions, 2 deletions
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;
}
|
