我讀問題時讀來的長度不是超過我文件實質(zhì)長度 更嚴(yán)重的是第一個字節(jié)讀不出來?? 我的代碼如下(文件長度為32 ),讀出來的來為Len = 0x38
補(bǔ)充一下 實質(zhì)內(nèi)存為81CE1CB0EC2C8FD800658EA7AE714454 讀出來為1CE1CB0EC2C8FD800658EA7AE7144544
if( CH376FileOpenPath( "/UPDATE.HTU" ) == USB_INT_SUCCESS ) { u8 *md5buf = mymalloc( 40 ); if( NULL != md5buf ) { UINT16 Len = 0; CH376ByteLocate( 0 ); if( USB_INT_SUCCESS == CH376ByteRead( md5buf, 32, &Len ) ) { debugPrintf( "Read UPDATE.HTU OK", sizeof( "Read UPDATE.HTU OK" ) ); CH376FileClose( FALSE ); if( Len == 32 ) { u8 i = 0; debugPrintf( "Read UPDATE.HTU len OK", sizeof( "Read UPDATE.HTU len OK" ) );
for(; i < 16; i++ ) { md5buf = ( AsciiToHex( md5buf[2 * i] ) << 4 ) | ( AsciiToHex( md5buf[2 * i + 1] ) ); debugPrintfHex2Ascii( md5buf, 16 ); } if( USB_INT_SUCCESS == CopyUpdateFile( "/UPDATE.BIN", md5buf ) ) { OSQPost( app_lcd_MsgQptr( ), (void*)( LCD_MSGQ_USB | LCD_USB_UPDATE_OK ) ); }else { OSQPost( app_lcd_MsgQptr( ), (void*)( LCD_MSGQ_USB | LCD_USB_UPDATE_FAIL ) ); } } } myfree( md5buf, 40 ); } }