summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwuyangyong <[email protected]>2010-02-22 14:56:51 +0000
committerwuyangyong <[email protected]>2010-02-22 14:56:51 +0000
commit83c6cd9b014271a9f8336fb283a77d86bcc78254 (patch)
tree9112a2ddd79f8ca7a0bd2e102e327df07d617afe
parent36773903357cc77d368f156a8e0dc2f5a124e001 (diff)
fix stm32 usb_msc auto_remove
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@432 bbd45198-f89e-11dd-88c7-29a3b14d5316
-rw-r--r--bsp/stm32_radio/Libraries/Mass_Storage/src/mass_mal.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/bsp/stm32_radio/Libraries/Mass_Storage/src/mass_mal.c b/bsp/stm32_radio/Libraries/Mass_Storage/src/mass_mal.c
index 0399f4cc94..37cef20559 100644
--- a/bsp/stm32_radio/Libraries/Mass_Storage/src/mass_mal.c
+++ b/bsp/stm32_radio/Libraries/Mass_Storage/src/mass_mal.c
@@ -27,6 +27,9 @@ uint32_t Max_Lun = 2;
rt_device_t dev_sdio = RT_NULL;
rt_device_t dev_spi_flash = RT_NULL;
+#if (USB_USE_AUTO_REMOVE == 1)
+unsigned long test_unit_ready_last = 0;
+#endif
uint16_t MAL_Init(uint8_t lun)
{
@@ -51,7 +54,9 @@ uint16_t MAL_Init(uint8_t lun)
uint16_t MAL_Write(uint8_t lun, uint32_t Memory_Offset, uint32_t *Writebuff, uint16_t Transfer_Length)
{
-
+#if (USB_USE_AUTO_REMOVE == 1)
+ test_unit_ready_last = rt_tick_get();
+#endif
switch (lun)
{
case 0:
@@ -72,7 +77,9 @@ uint16_t MAL_Write(uint8_t lun, uint32_t Memory_Offset, uint32_t *Writebuff, uin
uint16_t MAL_Read(uint8_t lun, uint32_t Memory_Offset, uint32_t *Readbuff, uint16_t Transfer_Length)
{
-
+#if (USB_USE_AUTO_REMOVE == 1)
+ test_unit_ready_last = rt_tick_get();
+#endif
switch (lun)
{
case 0:
@@ -91,9 +98,6 @@ uint16_t MAL_Read(uint8_t lun, uint32_t Memory_Offset, uint32_t *Readbuff, uint1
return MAL_OK;
}
-#if (USB_USE_AUTO_REMOVE == 1)
-unsigned long test_unit_ready_last = 0;
-#endif
uint16_t MAL_GetStatus (uint8_t lun)
{
#if (USB_USE_AUTO_REMOVE == 1)