void CH376FileOpen( void ) /* 在根目录或者当前目录下打开文件或者目录(文件夹) */ { unsigned char res = 0; unsigned char i,j; mDelaymS( 200 ); Nop(); i = 0; CH376WriteCmd( CMD10_SET_FILE_NAME );// 0x2F /* 设置文件名 */ CH376WriteData(FileName[0]); while ( FileName[i] ) { i++; Nop(); Nop(); if ( FileName[i] == DEF_SEPAR_CHAR1 || FileName[i] == DEF_SEPAR_CHAR2 ) FileName[i] = 0; /* 强行将文件名截止 */ Nop(); CH376WriteData( FileName[i] ); } Nop(); /* 延迟 */ Nop(); CH376WriteCmd( CMD50_WRITE_VAR32 ); CH376WriteData( VAR_CURRENT_CLUST ); CH376WriteData( 0 ); CH376WriteData( 0 ); CH376WriteData( 0 ); CH376WriteData( 0 ); Nop(); /* 延迟 */ Nop(); CH376WriteCmd( CMD0H_FILE_OPEN ); while( USB_INT ) //等待中断 { Nop(); } mDelaymS( 100 ); CH376WriteCmd( CMD01_GET_STATUS);// 0x22 /* 获取中断状态*/ res = CH376ReadData(); Nop(); /* 延迟 */ Nop(); Nop(); /* 延迟 */ Nop(); if( res == 0x14 ) { return; } while(1) { LcdOpenErr(); } }
根目录下文件打开返回0x42 以上是子程序 其中 FileName[]储存的是根目录下的文件名 请问这是什么原因?