从NANDFLASH读数据写到U盘上, 总会有一些数据没写进文件里 看看我这段代码有没问题
UINT32 i; UINT32 PageAddr; unsigned char pBuf0[528] = {0};
PageAddr=0; i = CH375FileCreate( ); mStopIfError(i); while( PageAddr < 32768 ) { //共32768页 P10OUT ^= BIT5; PageRead(0, PageAddr, pBuf0); //从NANDFLASH读一页数据, 一页有528字节 delay_us(50); PageAddr+=1; i = 0; for(n=0;n<528;n++) { //serial_put_char(pBuf0[n]); mCmdParam.ByteWrite.mByteBuffer[i] = pBuf0[n]; i+=1; if (i == 24) //一次写入24个字节, 528/24=22次 { mCmdParam.ByteWrite.mByteCount = (UINT8)i; i = 0; CH375ByteWrite( ); // 向文件写入数据 P10OUT ^= BIT6; } } }