mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
fix an "extra" semaphore wait in msc host
This commit is contained in:
parent
eb1a101667
commit
bfa96ae9da
@ -83,8 +83,6 @@ int __sys_write (int iFileHandle, char *pcBuffer, int iLength)
|
|||||||
|
|
||||||
#elif CFG_PRINTF_TARGET == PRINTF_TARGET_SWO
|
#elif CFG_PRINTF_TARGET == PRINTF_TARGET_SWO
|
||||||
#error author does not know how to retarget SWO with lpcxpresso/red-suite
|
#error author does not know how to retarget SWO with lpcxpresso/red-suite
|
||||||
#else
|
|
||||||
#error Thach, did you forget something
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -95,8 +95,8 @@ void tusbh_msc_mounted_cb(uint8_t dev_addr)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
puts("---------------------------------------------------------------------");
|
puts("-------------------------------------------------------------------");
|
||||||
puts("- MASSSTORAGE CLASS CLI IS A NON-MATURE CODE. DISK-WRITING COMMANDS -");
|
puts("- MASSSTORAGE CLASS CLI IS A IMMATURE CODE. DISK-WRITING COMMANDS -");
|
||||||
puts("- SUCH AS cp(COPY), mkdir(MAKE DIRECTORY) ARE POTENTIAL TO DAMAGE -");
|
puts("- SUCH AS cp(COPY), mkdir(MAKE DIRECTORY) ARE POTENTIAL TO DAMAGE -");
|
||||||
puts("- YOUR USB THUMBDRIVE. USING THOSE COMMANDS ARE AT YOUR OWN RISK. -");
|
puts("- YOUR USB THUMBDRIVE. USING THOSE COMMANDS ARE AT YOUR OWN RISK. -");
|
||||||
puts("- THE AUTHOR HAS NO RESPONSIBILITY WITH YOUR DEVICE NOR ITS DATA -");
|
puts("- THE AUTHOR HAS NO RESPONSIBILITY WITH YOUR DEVICE NOR ITS DATA -");
|
||||||
|
@ -380,7 +380,7 @@ tusb_error_t msch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
|
|||||||
);
|
);
|
||||||
|
|
||||||
hcd_pipe_clear_stall(msch_data[dev_addr-1].bulk_in);
|
hcd_pipe_clear_stall(msch_data[dev_addr-1].bulk_in);
|
||||||
osal_semaphore_wait(msch_sem_hdl, SCSI_XFER_TIMEOUT, &error);
|
osal_semaphore_wait(msch_sem_hdl, SCSI_XFER_TIMEOUT, &error); // wait for SCSI status
|
||||||
SUBTASK_ASSERT_STATUS(error);
|
SUBTASK_ASSERT_STATUS(error);
|
||||||
|
|
||||||
//------------- SCSI Request Sense -------------//
|
//------------- SCSI Request Sense -------------//
|
||||||
@ -397,8 +397,6 @@ tusb_error_t msch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
|
|||||||
msch_data[dev_addr-1].last_lba = __be2le( ((scsi_read_capacity10_data_t*)msch_buffer)->last_lba );
|
msch_data[dev_addr-1].last_lba = __be2le( ((scsi_read_capacity10_data_t*)msch_buffer)->last_lba );
|
||||||
msch_data[dev_addr-1].block_size = (uint16_t) __be2le( ((scsi_read_capacity10_data_t*)msch_buffer)->block_size );
|
msch_data[dev_addr-1].block_size = (uint16_t) __be2le( ((scsi_read_capacity10_data_t*)msch_buffer)->block_size );
|
||||||
|
|
||||||
osal_semaphore_wait(msch_sem_hdl, SCSI_XFER_TIMEOUT, &error);
|
|
||||||
|
|
||||||
msch_data[dev_addr-1].is_initialized = true;
|
msch_data[dev_addr-1].is_initialized = true;
|
||||||
tusbh_msc_mounted_cb(dev_addr);
|
tusbh_msc_mounted_cb(dev_addr);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user