請(qǐng)幫忙看下代碼可否優(yōu)化

我用的LPC2294,用IO方式寫的讀寫函數(shù),但是速度寫U盤速度慢,請(qǐng)幫忙看下代碼能否優(yōu)化

void usb_write_command( uint8 mCmd ) { mDelay1_2uS( ); IO2DIR |= 0xffff; IO2SET |= mCmd; IO3SET |= addr0; IO3CLR |= we; IO1CLR |= cs0; IO3SET |= we; IO1SET |= cs0; IO2CLR |= mCmd; IO2DIR &= 0x00; mDelay2uS(); }

void usb_write_data( uint8 mData ) { mDelay1_2uS( ); IO2DIR |= 0xffff; IO2SET |= mData;

IO3CLR |= we |addr0; IO1CLR |= cs0; IO3SET |= we; IO1SET |= cs0; IO2CLR |= mData; IO2DIR &= 0x00; mDelay1_2uS( ); }

uint8 usb_read( void ) { uint8 mData;

mDelay1_2uS(); IO2DIR &= 0x00000000; IO1CLR |= cs0 |rd; IO3CLR |= addr0;

mData = IO2PIN; IO1SET |= cs0 |rd; return( mData ); }

你可以按照下面的看下速度可以不可以提高: void usb_write_command( uint8 mCmd ) { IO2DIR |= 0xffff; IO2SET |= mCmd; IO3SET |= addr0;

IO3CLR |= we; IO1CLR |= cs0;

IO3SET |= we; IO1SET |= cs0; IO2CLR |= mCmd;

IO2DIR &= 0x00; mDelay2uS(); }

void usb_write_data( uint8 mData ) { IO2DIR |= 0xffff; IO2SET |= mData;

IO3CLR |= we |addr0; IO1CLR |= cs0;

IO3SET |= we; IO1SET |= cs0; IO2CLR |= mData;

IO2DIR &= 0x00; mDelay1_2uS( ); }

uint8 usb_read( void ) { uint8 mData;

IO2DIR &= 0x00000000;

IO1CLR |= cs0 |rd; IO3CLR |= addr0;

mData = IO2PIN; IO1SET |= cs0 |rd; mDelay1_2uS();

return( mData );


CH375B能不能達(dá)到這樣的速度,15分鐘把512MB的數(shù)據(jù)寫入U(xiǎn)盤,也就是大約580KB/S的樣子,寫一個(gè)字節(jié)的時(shí)間大概是1.6,1.7us的時(shí)間。如果可以達(dá)到的話,有什么要求呢?比方說對(duì)U盤的要求或者程序的優(yōu)化


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

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