From 24a5dd5a7d5fb9a2ef5d687a1dd9dccca31a9890 Mon Sep 17 00:00:00 2001 From: yosiokat Date: Sat, 6 Sep 2008 05:20:03 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=88=E6=99=82=E3=81=ABRTC=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AB=E5=A4=B1=E6=95=97=E3=81=97=E3=81=9F?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=80=81=EF=BC=93=E5=9B=9E=E3=81=BE=E3=81=A7?= =?UTF-8?q?=E3=83=AA=E3=83=88=E3=83=A9=E3=82=A4=E3=81=97=E3=81=A6=E3=83=80?= =?UTF-8?q?=E3=83=A1=E3=81=A0=E3=81=A3=E3=81=9F=E5=A0=B4=E5=90=88=E3=81=AF?= =?UTF-8?q?=E6=97=A5=E4=BB=98=E3=83=BB=E6=99=82=E5=88=BB=E3=82=92=EF=BC=90?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=82=A2=20=E3=81=97=E3=81=A6=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=92=E7=B6=99=E7=B6=9A=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E5=A4=89=E6=9B=B4=E3=80=82?= 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@2422 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- .../errorLog/ARM9/src/errorLog.c | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/build/libraries_sysmenu/errorLog/ARM9/src/errorLog.c b/build/libraries_sysmenu/errorLog/ARM9/src/errorLog.c index c096bf5e..9e8a1a28 100644 --- a/build/libraries_sysmenu/errorLog/ARM9/src/errorLog.c +++ b/build/libraries_sysmenu/errorLog/ARM9/src/errorLog.c @@ -253,22 +253,30 @@ BOOL ERRORLOGi_WriteCommon( BOOL isLauncherError, u64 errorCode, const char *fmt int bufBeginPoint = 0; // リングバッファの開始点 int numEntry = 0; int counter = 0; - + int retry = 3; + RTCDate date; RTCTime time; - RTCResult rtcRes; char *writeBuf; writeBuf = (char*) elWork.Alloc( ERRORLOG_SIZE ); SDK_ASSERT( writeBuf ); - // 新しいログエントリを書き込むためのRTC - if( ( rtcRes = RTC_GetDateTime( &date, &time )) != RTC_RESULT_SUCCESS ) - { - elWork.Free( writeBuf ); - OS_TPrintf("EL Error: RTC getDateTime() Failed! Status:%d\n", rtcRes); - return FALSE; + // RTCが初期化されていない場合の保険 + RTC_Init(); + + // 新しいログエントリを書き込むためのRTCリード + while( retry-- > 0 ) { + if( RTC_GetDateTime( &date, &time ) == RTC_RESULT_SUCCESS ) { + break; + } + OS_Sleep(1); + } + if( retry < 0 ) { + // RTCリードに失敗した場合でも、オール0の値をセットして続行(マルチスレッド動作時にRTCアクセスは失敗する可能性がある) + MI_CpuClear8( &date, sizeof(RTCDate) ); + MI_CpuClear8( &time, sizeof(RTCTime) ); } if( isLauncherError )