From 1319c59d2363f81547c8ebc395c770917c7d88ae Mon Sep 17 00:00:00 2001 From: yutaka Date: Fri, 20 Jun 2008 02:18:23 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=A2=E3=83=89=E3=83=AC=E3=82=B9=E3=81=AE?= =?UTF-8?q?=E4=B8=8A=E9=99=90=E5=88=A4=E5=AE=9A=E5=89=8A=E9=99=A4=E3=80=81?= =?UTF-8?q?=20=E3=82=B9=E3=82=AD=E3=83=83=E3=83=97=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E8=A1=8C=E5=88=A4=E5=AE=9A=E3=81=AE=E5=89=8A=E9=99=A4=E3=80=81?= =?UTF-8?q?=20=E6=88=90=E5=90=A6=E5=88=A4=E5=AE=9A=E3=81=AE=E3=83=9D?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=88=E9=99=90=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@1666 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../common/ARM7/src/mcu_firm.c | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/build/systemMenu_tools/common/ARM7/src/mcu_firm.c b/build/systemMenu_tools/common/ARM7/src/mcu_firm.c index 6b40a2c2..fb3889bf 100644 --- a/build/systemMenu_tools/common/ARM7/src/mcu_firm.c +++ b/build/systemMenu_tools/common/ARM7/src/mcu_firm.c @@ -173,7 +173,6 @@ static inline BOOL I2Ci_SendLast( u8 data ) BOOL MCU_WriteFirm(const unsigned char* hex) { BOOL result = TRUE; - BOOL temp; if ( !hex ) { @@ -192,37 +191,28 @@ BOOL MCU_WriteFirm(const unsigned char* hex) slowRate = SLOW_RATE_LONG; // main phase - while ( hex[0] == ':' && ( hex[3] < '2' || (hex[3] == '2' && hex[4] < '4') )) // フォーマットが正しく0x2400以前のアドレスである場合に処理する + while ( hex[0] == ':' ) // ':'から始まっている限りループする { - // データ終端チェック (基本的にこの前で終了している) - if ( !MI_CpuComp8( hex, ":00000001FF", 11) ) - { - break; - } - // 無視行チェック - if ( hex[1] == '1' && hex[2] == '0' && !MI_CpuComp8( &hex[9], "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 32 ) ) - { - while ( *hex++ != '\n' ) - { - // skip - } - continue; - } + int isContinue = MI_CpuComp8( hex, ":00000001FF", 11); // データ終端チェック + // 最初の1文字 (':'のはず) result &= I2Ci_SendMiddle( *hex++ ); slowRate = SLOW_RATE_SHORT; // 通常出力 - temp = TRUE; /* 1回遅延させることで'\n'の結果を無視する */ do { - result &= temp; - temp = I2Ci_SendMiddle( *hex ); + I2Ci_SendMiddle( *hex ); } while ( *hex++ != '\n' ); slowRate = SLOW_RATE_ENTER; + + if ( !isContinue ) // 最終行だった + { + break; + } } // stop phase (only 2nd call)