From 478546fcf51e9bc4a3c2f5fa2c98e8eae2e19a18 Mon Sep 17 00:00:00 2001 From: yutaka Date: Wed, 18 Jun 2008 06:58:48 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=9F=E3=83=B3=E3=82=B0?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= 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@1646 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- build/systemMenu_tools/common/ARM7/src/mcu_firm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build/systemMenu_tools/common/ARM7/src/mcu_firm.c b/build/systemMenu_tools/common/ARM7/src/mcu_firm.c index 2920087b..d5601e44 100644 --- a/build/systemMenu_tools/common/ARM7/src/mcu_firm.c +++ b/build/systemMenu_tools/common/ARM7/src/mcu_firm.c @@ -166,15 +166,20 @@ static inline BOOL I2Ci_SendLast( u8 data ) } #define SLOW_RATE_DEFAULT 0x50 -#define SLOW_RATE_SHORT 0x0 +#define SLOW_RATE_SHORT 0x140 #define SLOW_RATE_LONG (HW_CPU_CLOCK_ARM7 / 13) // 300msec -#define SLOW_RATE_ENTER (HW_CPU_CLOCK_ARM7 / 180) // 22msec +#define SLOW_RATE_ENTER (HW_CPU_CLOCK_ARM7 / 160) // 25msec BOOL MCU_WriteFirm(const unsigned char* hex) { BOOL result = TRUE; BOOL temp; + if ( !hex ) + { + return FALSE; // no data + } + I2C_Lock(); slowRate = SLOW_RATE_DEFAULT; @@ -187,7 +192,7 @@ BOOL MCU_WriteFirm(const unsigned char* hex) slowRate = SLOW_RATE_LONG; // main phase - while ( hex[0] == ':' && hex[3] < '3' ) // フォーマットが正しく0x3000以前のアドレスである場合に処理する + while ( hex[0] == ':' && ( hex[3] < '2' || (hex[3] == '2' && hex[4] < '4') ) // フォーマットが正しく0x2400以前のアドレスである場合に処理する { // データ終端チェック (基本的にこの前で終了している) if ( !MI_CpuComp8( hex, ":00000001FF", 11) )