fix auto_restart if no USB cable

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@433 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
wuyangyong 2010-02-22 15:30:42 +00:00
parent 83c6cd9b01
commit cbda63c500
1 changed files with 10 additions and 1 deletions

View File

@ -16,7 +16,16 @@ extern rt_device_t dev_spi_flash;
extern unsigned long test_unit_ready_last;
void msc_thread_entry(void *parameter)
{
test_unit_ready_last = rt_tick_get();
unsigned long test_unit_ready_start = rt_tick_get();
test_unit_ready_last = test_unit_ready_start;
/* wait connection */
while( test_unit_ready_last == test_unit_ready_start )
{
rt_thread_delay( RT_TICK_PER_SECOND );
}
/* wait remove */
while(1)
{
rt_thread_delay( RT_TICK_PER_SECOND/2 );