現(xiàn)在可以建立文件名,但是寫數(shù)據(jù)時,s = Wait376Interrupt( );,s值總是0X14;函數(shù)如下:
UINT8 CH376ByteWrite( PUINT8 buf, UINT16 ReqCount, PUINT16 RealCount ) /* 以字節(jié)為單位向當(dāng)前位置寫入數(shù)據(jù)塊 */ { UINT8 s; WriteCH376Cmd( CMD2H_BYTE_WRITE ); WriteCH376Data( (UINT8)ReqCount ); WriteCH376Data( (UINT8)(ReqCount>>8) ); EndCH376Cmd( ); if ( RealCount ) *RealCount = 0; while ( 1 ) { s = Wait376Interrupt( ); Dlayms(100); if ( s == USB_INT_DISK_WRITE ) { s = CH376WriteReqBlock( buf ); /* 向內(nèi)部指定緩沖區(qū)寫入請求的數(shù)據(jù)塊,返回長度 */ WriteCH376Cmd( CMD0H_BYTE_WR_GO ); EndCH376Cmd( ); buf += s; if ( RealCount ) *RealCount += s; } /* else if ( s == USB_INT_SUCCESS ) return( s );*/ /* 結(jié)束 */ else return( s ); /* 錯誤 */ } }