初始化时返回的一直是0XFA,请问是什么原因?谢谢!
//初始化函数
UINT8 mInitCH376Host( void )
{
UINT8res;
CH376_PORT_INIT( );
xWriteCH376Cmd( CMD11_CHECK_EXIST );
xWriteCH376Data( 0x55 );
res = xReadCH376Data( );
if ( res != 0xAA )
{
return( ERR_USB_UNKNOWN );
}
xWriteCH376Cmd( CMD11_SET_USB_MODE );
xWriteCH376Data( 0x06 );
mDelayuS( 20 );
res = xReadCH376Data( );
if ( res == CMD_RET_SUCCESS )
{
return( USB_INT_SUCCESS );
}
else
{
return( ERR_USB_UNKNOWN );
}
}
//下面是主函数的一部分
void main( )
{
UINT8 i, s;
P_FAT_DIR_INFOpDir;
UINT8xdataSrcName[64];
UINT8xdataTarName[64];
P35= 1;
mDelaymS( 100 );
P35= 0;
mDelaymS( 200 );
mInitSTDIO( );
printf( "Start\n" );
s = mInitCH376Host( );
mStopIfError( s );
}