DRESULT disk_read (
BYTE drv, /* Physical drive number (0) */
BYTE *buff, /* Pointer to the data buffer to store read data */
DWORD sector, /* Start sector number (LBA) */
BYTE count /* Sector count (1..255) */
)
{
BYTE status = USBH_MSC_OK;
if (drv || !count) return RES_PARERR;
if (Stat & STA_NOINIT) return RES_NOTRDY;
if(HCD_IsDeviceConnected(&USB_OTG_Core))
{
do
{
status = USBH_MSC_Read10(&USB_OTG_Core, buff,sector,512 * count);
USBH_MSC_HandleBOTXfer(&USB_OTG_Core ,&USB_Host);
if(!HCD_IsDeviceConnected(&USB_OTG_Core))
{
return RES_ERROR;
}
}
while(status == USBH_MSC_BUSY );
}
if(status == USBH_MSC_OK)
return RES_OK;
return RES_ERROR;
}
在只处理U盘写工程里OK,每5SEC 保存15bye 数到U盘当中,
但是加入到另外一个工程里,里面有开UART中断/ 定时中断5,
在写入几组数据后就在。。。。
disk_read 函数里出来不来了,
[size=14.44444465637207px] status = USBH_MSC_Read10(&USB_OTG_Core, buff,sector,512 * count);
返回一直是 USBH_MSC_BUSY ...
是否有人碰到过,如何解决呢?
请问一下,是什么原因?
|