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
@ -241,7 +241,7 @@ void hidh_close(uint8_t dev_addr)
|
||||
hidh_device_t* hid_dev = get_dev(dev_addr);
|
||||
if (tuh_hid_umount_cb)
|
||||
{
|
||||
for ( uint8_t inst = 0; inst < hid_dev->inst_count; inst++) tuh_hid_umount_cb(dev_addr, inst);
|
||||
for ( uint8_t inst = 0; inst < hid_dev->inst_count; inst++ ) tuh_hid_umount_cb(dev_addr, inst);
|
||||
}
|
||||
|
||||
tu_memclr(hid_dev, sizeof(hidh_device_t));
|
||||
|
@ -297,10 +297,11 @@ void msch_init(void)
|
||||
void msch_close(uint8_t dev_addr)
|
||||
{
|
||||
msch_interface_t* p_msc = get_itf(dev_addr);
|
||||
tu_memclr(p_msc, sizeof(msch_interface_t));
|
||||
|
||||
// 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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user