mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-19 06:40:45 +00:00
make tuh_msc_mount_cb() tuh_msc_unmount_cb() as weak callback
This commit is contained in:
parent
e0dbb489ae
commit
510beef9f8
@ -287,7 +287,7 @@ bool tuh_msc_reset(uint8_t dev_addr)
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// CLASS-USBH API (don't require to verify parameters)
|
||||
// CLASS-USBH API
|
||||
//--------------------------------------------------------------------+
|
||||
void msch_init(void)
|
||||
{
|
||||
@ -298,7 +298,9 @@ void msch_close(uint8_t dev_addr)
|
||||
{
|
||||
msch_interface_t* p_msc = get_itf(dev_addr);
|
||||
tu_memclr(p_msc, sizeof(msch_interface_t));
|
||||
tuh_msc_unmount_cb(dev_addr); // invoke Application Callback
|
||||
|
||||
// invoke Application Callback
|
||||
if (tuh_msc_unmount_cb) tuh_msc_unmount_cb(dev_addr);
|
||||
}
|
||||
|
||||
bool msch_xfer_cb(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes)
|
||||
@ -471,8 +473,9 @@ static bool config_read_capacity_complete(uint8_t dev_addr, msc_cbw_t const* cbw
|
||||
|
||||
// Mark enumeration is complete
|
||||
p_msc->mounted = true;
|
||||
tuh_msc_mount_cb(dev_addr);
|
||||
if (tuh_msc_mount_cb) tuh_msc_mount_cb(dev_addr);
|
||||
|
||||
// notify usbh that driver enumeration is complete
|
||||
usbh_driver_set_config_complete(dev_addr, p_msc->itf_num);
|
||||
|
||||
return true;
|
||||
|
@ -106,10 +106,10 @@ bool tuh_msc_read_capacity(uint8_t dev_addr, uint8_t lun, scsi_read_capacity10_r
|
||||
//------------- Application Callback -------------//
|
||||
|
||||
// Invoked when a device with MassStorage interface is mounted
|
||||
void tuh_msc_mount_cb(uint8_t dev_addr);
|
||||
TU_ATTR_WEAK void tuh_msc_mount_cb(uint8_t dev_addr);
|
||||
|
||||
// Invoked when a device with MassStorage interface is unmounted
|
||||
void tuh_msc_unmount_cb(uint8_t dev_addr);
|
||||
TU_ATTR_WEAK void tuh_msc_unmount_cb(uint8_t dev_addr);
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Internal Class Driver API
|
||||
|
Loading…
x
Reference in New Issue
Block a user