求助串口讀CH376

if (InitCH376Host() == USB_INT_SUCCESS) { if (CH376DiskConnect()== USB_INT_SUCCESS) { while(1); } else { if(CH376DiskMount() != USB_INT_SUCCESS) { Dlayms(100); while(1); } else { strcpy(buf, "\ABC.TXT"); if(CH376FileOpen(buf)==USB_INT_SUCCESS) { CH376ByteRead( buf, 30, &RealCount ); } } } } 前面都正常,運(yùn)行 CH376ByteRead( buf, 30, &RealCount );時(shí),s = Wait376Interrupt( );s=0x14,不是USB_INT_DISK_READ ,一直進(jìn)不去,不知什么原因。下面是CH376ByteRead函數(shù)。

UINT8 CH376ByteRead( PUINT8 buf, UINT16 ReqCount, PUINT16 RealCount ) /* 以字節(jié)為單位從當(dāng)前位置讀取數(shù)據(jù)塊 */ { UINT8 s; WriteCH376Cmd(CMD2H_BYTE_READ); WriteCH376Data((UINT8)ReqCount); WriteCH376Data((UINT8)(ReqCount>>8)); if (RealCount) { *RealCount = 0; } while ( 1 ) { s = Wait376Interrupt( ); if ( s == USB_INT_DISK_READ ) { s = CH376ReadBlock( buf ); // 從當(dāng)前主機(jī)端點(diǎn)的接收緩沖區(qū)讀取數(shù)據(jù)塊,返回長(zhǎng)度 WriteCH376Cmd( CMD0H_BYTE_RD_GO ); buf += s; if ( RealCount ) { *RealCount += s; } } else { return( s ); /* 錯(cuò)誤 */ } } }

此問(wèn)題的回復(fù),請(qǐng)查看站內(nèi)貼:

http://www.findthetime.net/bbs/index.php?s=/index-thread-id-61616-p-1.html


只有登錄才能回復(fù),可以選擇微信賬號(hào)登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频