#ifdef EN_DISK_WRITE /* 子程序庫(kù)支持寫(xiě)操作 */ /* 產(chǎn)生新文件 */ LED_WR_ACT( ); /* 寫(xiě)操作 */ mCopyCodeStringToIRAM(mCmdParam.Open.mPathName,"/NEWFILE.TXT"); i=CH375FileOpen(); if(i==ERR_SUCCESS) { printf("File has been opend successful!\n"); mCmdParam.ByteLocate.mByteOffset=0xffffffff; CH375ByteLocate(); } else if(i==ERR_MISS_FILE) { printf("File has to be created!\n"); LED_WR_ACT(); mCopyCodeStringToIRAM(mCmdParam.Create.mPathName,"/NEWFILE.TXT"); i=CH375FileCreate(); mStopIfError(i); if(i==ERR_SUCCESS) printf("File has been created successfully!\n"); } else printf("open the file errors!\n"); LED_WR_ACT(); printf("write begin:\n");
for ( i=0; i<2; i++ ) //{
{ mCmdParam.ByteWrite.mByteBuffer = GetDataFromIO(); printf("%02X\n",(UINT16)mCmdParam.ByteWrite.mByteBuffer); mCmdParam.ByteWrite.mByteCount = i; /* 寫(xiě)入數(shù)據(jù)的字符數(shù),單次讀寫(xiě)的長(zhǎng)度不能超過(guò)MAX_BYTE_IO,第二次調(diào)用時(shí)接著剛才的向后寫(xiě) */ i = CH375ByteWrite( ); /* 向文件寫(xiě)入數(shù)據(jù) */ mStopIfError( i ); if(i==ERR_SUCCESS) printf("write is over!\n"); // } } 這是一段從串口接收數(shù)據(jù) 寫(xiě)入U(xiǎn)盤(pán)的其中一部分程序 現(xiàn)在發(fā)現(xiàn)從串口接收以后 寫(xiě)入的時(shí)候返回的是0x1f 也就是不能寫(xiě)入,為什么啊 請(qǐng)幫我看看