通過例程里面的CH376ByteWrite函數(shù)發(fā)送數(shù)據(jù),發(fā)現(xiàn)死在if ( s == USB_INT_DISK_WRITE )這步,返回的都是14,寫不進(jìn)去數(shù)據(jù),自己修改后不加這步直接寫入可以,但是后續(xù)發(fā)現(xiàn)只能寫255byte,超過一個(gè)字節(jié)就寫不進(jìn)去,求解
UINT8CH376ByteWrite( PUINT8 buf, UINT16 ReqCount, PUINT16 RealCount )?
{
UINT8s;
xWriteCH376Cmd( CMD2H_BYTE_WRITE );
xWriteCH376Data( (UINT8)ReqCount );
xWriteCH376Data( (UINT8)(ReqCount>>8) );
//xEndCH376Cmd( );
//if ( RealCount ) *RealCount = 0;
////while ( 1 ) {
//s = Wait376Interrupt( );
////if ( s == USB_INT_DISK_WRITE ) {
//s = CH376WriteReqBlock( buf );? /* ?ò???????¨?????????????ó???????é,·????¤?? */
//xWriteCH376Cmd( CMD0H_BYTE_WR_GO );
////xEndCH376Cmd( );
//buf += s;
//if ( RealCount ) *RealCount += s;
////}
///*else if ( s == USB_INT_SUCCESS ) return( s );*/? /* ?á?? */
////else return( s );? /* ?í?ó */
//? ? return( s );? /* ?í?ó */
////}
? ??
? ? s = Wait376Interrupt();
? ? xWriteCH376Cmd(CMD_WR_REQ_DATA);?
? ? if(ReqCount)
? ? {
? ? ? ? do
? ? ? ? {
? ? ? ? ? ? xWriteCH376Data(*buf);
? ? ? ? ? ? buf++;
? ? ? ? }while(--ReqCount);
? ? }?
? ? xWriteCH376Cmd(CMD_BYTE_WR_GO);?
? ? s = Wait376Interrupt();? ? ? ??
? ??
? ? return s;
}