遇到了一個(gè)問(wèn)題,按照EXAM1里面做短文件名的根目錄枚舉,程序通過(guò),但是加入了EXAM11里面的顯示長(zhǎng)文件名的代碼之后,只能枚舉出來(lái)1個(gè)文件。(U盤(pán)里有3個(gè)文件,都是英文名。)請(qǐng)問(wèn)下各位能幫我看下這代碼嗎?為什么變?yōu)殚L(zhǎng)文件名輸出以后,Wait376Interrupt()返回了ERR_MISS_FILE ,即0x42?
短文件名根目錄枚舉主要代碼如下:(幾乎全是EXAM1里的代碼了)
strcpy((char *)buf,"\\*"); printf("List file %s\n",buf); s=CH376FileOpenPath(buf); while(s==USB_INT_DISK_READ) { CH376ReadBlock(buf); pDir=(P_FAT_DIR_INFO)buf; if(pDir->DIR_Name[0]!='.') { if(pDir->DIR_Name[0]==0x05) pDir->DIR_Name[0]=0xE5; pDir->DIR_Attr=0; printf("*** EnumName: %s\n",pDir->DIR_Name); } xWriteCH376Cmd(CMD0H_FILE_ENUM_GO); xEndCH376Cmd(); s=Wait376Interrupt(); printf("s=%02x",s); }
長(zhǎng)文件名根目錄枚舉主要代碼如下:(加入了部分EXAM11里的代碼)
strcpy((char *)buf,"\\*"); printf("List file %s\n",buf); s=CH376FileOpenPath(buf); while(s==USB_INT_DISK_READ) { CH376ReadBlock(buf); pDir=(P_FAT_DIR_INFO)buf; if(pDir->DIR_Name[0]!='.') { if(pDir->DIR_Name[0]==0x05) pDir->DIR_Name[0]=0xE5; pDir->DIR_Attr=0; s=CH376GetLongName(pDir->DIR_Name,LongNameBuf); for(j=0;j { printf("%c",LongNameBuf[j]); if(*(PUINT16)(&LongNameBuf[j])==0) break; } delay_ms(20); printf("s=%02x \n",s); } xWriteCH376Cmd(CMD0H_FILE_ENUM_GO); xEndCH376Cmd(); s=Wait376Interrupt(); printf("s=%02x",s); }
請(qǐng)問(wèn)為什么第二段程序中中斷直接就返回了ERR_MISS_FILE呢?