我在测试CH376时候发现文件定义有问题,
strcpy((char *)SrcName, "\\1\\");
s = CH376FileOpenPath(SrcName);
if ((s == ERR_MISS_DIR)||(s == ERR_MISS_FILE))
{
s = CH376DirCreate(SrcName);
if(s != USB_INT_SUCCESS)
{
m_u8USBStatus = USB_ERROR;
return;
}
}
strcpy((char *)SrcName, "\\1\\");
// //strcat((char *)SrcName,"\\");
//// i_u16Data = 2000;
//// i_u16Data+=BCD_TO_BIN(i_u8Buf[2]);
BIN_TO_ASCBUF(i_u8Buf[2],&i_u8TempBuf[0],2);
BIN_TO_ASCBUF(i_u8Buf[1],&i_u8TempBuf[2],2);
BIN_TO_ASCBUF(i_u8Buf[0],&i_u8TempBuf[4],2);
i_u8TempBuf[6] = 0;
strcat((char *)SrcName,(char *)i_u8TempBuf);
for(i=0;i<6;i++)
{
m_u8USBBuf[i_u8Len++] = i_u8TempBuf[i];
}
for(i=0;i<2;i++)
{
m_u8USBBuf[i_u8Len++] = ' ';
}
// strcat((char *)SrcName,".txt");
strcat( (char *)SrcName, ".TXT" );
s = CH376FileCreatePath(SrcName);
if(s != USB_INT_SUCCESS)
{
m_u8USBStatus = USB_ERROR;
return;
}
我如果把1改为Data就会出现问题,但是程序执行都是成功的,把U盘插电脑就会出现打不开这个Data这个文件夹。大家看看是不是哪里有问题。