大神们:
下面是USB_dev_msc主函数的主循环, 我真的没看出来他是怎么调用读写函数进行USB读写的,还是说他就是等着用户自己在“// If there is no activity then return to the idle state.”处填写读写动作呢??
while(1)
{
switch(g_eMSCState)
{
case MSC_DEV_READ:
{
//
// Update the screen if necessary.
//
if(g_ulFlags & FLAG_UPDATE_STATUS)
{
UpdateStatus("Reading", 0);
g_ulFlags &= ~FLAG_UPDATE_STATUS;
}
//
// If there is no activity then return to the idle state.
//
if(g_ulIdleTimeout == 0)
{
UpdateStatus("Idle ", 0);
g_eMSCState = MSC_DEV_IDLE;
}
break;
}
case MSC_DEV_WRITE:
{
//
// Update the screen if necessary.
//
if(g_ulFlags & FLAG_UPDATE_STATUS)
{
UpdateStatus("Writing ", 0);
g_ulFlags &= ~FLAG_UPDATE_STATUS;
}
//
// If there is no activity then return to the idle state.
//
if(g_ulIdleTimeout == 0)
{
UpdateStatus("Idle ", 0);
g_eMSCState = MSC_DEV_IDLE;
}
break;
}
case MSC_DEV_IDLE:
default:
{
break;
}
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>