mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
only invoke tuh_msc_umount_cb() if needed
This commit is contained in:
parent
8cffe4897e
commit
3654d96e07
@ -297,10 +297,11 @@ void msch_init(void)
|
|||||||
void msch_close(uint8_t dev_addr)
|
void msch_close(uint8_t dev_addr)
|
||||||
{
|
{
|
||||||
msch_interface_t* p_msc = get_itf(dev_addr);
|
msch_interface_t* p_msc = get_itf(dev_addr);
|
||||||
tu_memclr(p_msc, sizeof(msch_interface_t));
|
|
||||||
|
|
||||||
// invoke Application Callback
|
// invoke Application Callback
|
||||||
if (tuh_msc_umount_cb) tuh_msc_umount_cb(dev_addr);
|
if (p_msc->mounted && tuh_msc_umount_cb) tuh_msc_umount_cb(dev_addr);
|
||||||
|
|
||||||
|
tu_memclr(p_msc, sizeof(msch_interface_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool msch_xfer_cb(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes)
|
bool msch_xfer_cb(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user