rework tuh_msc_complete_cb_t signature to use new tuh_msc_complete_data_t
add user arg to all scsi command API that support complete callback
This commit is contained in:
@@ -30,8 +30,11 @@
|
||||
//--------------------------------------------------------------------+
|
||||
static scsi_inquiry_resp_t inquiry_resp;
|
||||
|
||||
bool inquiry_complete_cb(uint8_t dev_addr, msc_cbw_t const* cbw, msc_csw_t const* csw)
|
||||
bool inquiry_complete_cb(uint8_t dev_addr, tuh_msc_complete_data_t const * cb_data)
|
||||
{
|
||||
msc_cbw_t const* cbw = cb_data->cbw;
|
||||
msc_csw_t const* csw = cb_data->csw;
|
||||
|
||||
if (csw->status != 0)
|
||||
{
|
||||
printf("Inquiry failed\r\n");
|
||||
@@ -57,47 +60,12 @@ void tuh_msc_mount_cb(uint8_t dev_addr)
|
||||
printf("A MassStorage device is mounted\r\n");
|
||||
|
||||
uint8_t const lun = 0;
|
||||
tuh_msc_inquiry(dev_addr, lun, &inquiry_resp, inquiry_complete_cb);
|
||||
//
|
||||
// //------------- file system (only 1 LUN support) -------------//
|
||||
// uint8_t phy_disk = dev_addr-1;
|
||||
// disk_initialize(phy_disk);
|
||||
//
|
||||
// if ( disk_is_ready(phy_disk) )
|
||||
// {
|
||||
// if ( f_mount(phy_disk, &fatfs[phy_disk]) != FR_OK )
|
||||
// {
|
||||
// puts("mount failed");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// f_chdrive(phy_disk); // change to newly mounted drive
|
||||
// f_chdir("/"); // root as current dir
|
||||
//
|
||||
// cli_init();
|
||||
// }
|
||||
tuh_msc_inquiry(dev_addr, lun, &inquiry_resp, inquiry_complete_cb, 0);
|
||||
}
|
||||
|
||||
void tuh_msc_umount_cb(uint8_t dev_addr)
|
||||
{
|
||||
(void) dev_addr;
|
||||
printf("A MassStorage device is unmounted\r\n");
|
||||
|
||||
// uint8_t phy_disk = dev_addr-1;
|
||||
//
|
||||
// f_mount(phy_disk, NULL); // unmount disk
|
||||
// disk_deinitialize(phy_disk);
|
||||
//
|
||||
// if ( phy_disk == f_get_current_drive() )
|
||||
// { // active drive is unplugged --> change to other drive
|
||||
// for(uint8_t i=0; i<CFG_TUH_DEVICE_MAX; i++)
|
||||
// {
|
||||
// if ( disk_is_ready(i) )
|
||||
// {
|
||||
// f_chdrive(i);
|
||||
// cli_init(); // refractor, rename
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user