#ifdef EN_DISK_WRITE /* 子程序库支持写操作 */ /* 产生新文件 */ LED_WR_ACT( ); /* 写操作 */ 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; /* 写入数据的字符数,单次读写的长度不能超过MAX_BYTE_IO,第二次调用时接着刚才的向后写 */ i = CH375ByteWrite( ); /* 向文件写入数据 */ mStopIfError( i ); if(i==ERR_SUCCESS) printf("write is over!\n"); // } } 这是一段从串口接收数据 写入U盘的其中一部分程序 现在发现从串口接收以后 写入的时候返回的是0x1f 也就是不能写入,为什么啊 请帮我看看