我每平均1秒往U盤里寫一條數(shù)據(jù)作測試,一般在寫到100條或1000條之間的時候,數(shù)據(jù)就寫不進去了,單片機重啟,可以繼續(xù)寫,但也是這樣的結(jié)果,寫著寫著CH376S好像就不工作了一樣,不知道是什么原因?
代碼如下:
void WriteUdata(u16 CNT)
{
u8TarName[64];
u8 Ubuf[8];
u8 StartBuf[9] = {"Samsung:"};
? u8 EndBuf[5] = {"\r\n"};
Ubuf[0] = CNT / 10000 + 0x30;
Ubuf[1] = (CNT % 10000)/1000 + 0x30;
Ubuf[2] = ((CNT % 10000)%1000)/100 + 0x30;
Ubuf[3] = ((CNT % 10000)%1000%100)/10 + 0x30;
Ubuf[4] = (CNT % 10000)%1000%100%10 + 0x30;
Ubuf[5] = 0x0A;
Ubuf[6] = 0x0D;
strcpy( (char *)TarName, "\\AAAAAAAA.TXT" );?
si = CH376FileOpenPath(TarName);
CH376ByteLocate(0xFFFFFFFF);
mDelaymS(200);
mDelaymS(200);
si = CH376ByteWrite( StartBuf,9, NULL );?
si = CH376ByteWrite( Ubuf,7, NULL );?
si = CH376ByteWrite( EndBuf,5, NULL );?
si = CH376FileClose( TRUE ); ?
mDelaymS(200);
}