通过例程里面的CH376ByteWrite函数发送数据,发现死在if ( s == USB_INT_DISK_WRITE )这步,返回的都是14,写不进去数据,自己修改后不加这步直接写入可以,但是后续发现只能写255byte,超过一个字节就写不进去,求解
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;
}