エラーログライト時にRTCリードに失敗した場合、3回までリトライしてダメだった場合は日付・時刻を0クリア

して処理を継続するよう変更。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2422 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
yosiokat 2008-09-06 05:20:03 +00:00
parent a937e91a6a
commit 24a5dd5a7d

View File

@ -253,22 +253,30 @@ BOOL ERRORLOGi_WriteCommon( BOOL isLauncherError, u64 errorCode, const char *fmt
int bufBeginPoint = 0; // リングバッファの開始点 int bufBeginPoint = 0; // リングバッファの開始点
int numEntry = 0; int numEntry = 0;
int counter = 0; int counter = 0;
int retry = 3;
RTCDate date; RTCDate date;
RTCTime time; RTCTime time;
RTCResult rtcRes;
char *writeBuf; char *writeBuf;
writeBuf = (char*) elWork.Alloc( ERRORLOG_SIZE ); writeBuf = (char*) elWork.Alloc( ERRORLOG_SIZE );
SDK_ASSERT( writeBuf ); SDK_ASSERT( writeBuf );
// 新しいログエントリを書き込むためのRTC // RTCが初期化されていない場合の保険
if( ( rtcRes = RTC_GetDateTime( &date, &time )) != RTC_RESULT_SUCCESS ) RTC_Init();
{
elWork.Free( writeBuf ); // 新しいログエントリを書き込むためのRTCリード
OS_TPrintf("EL Error: RTC getDateTime() Failed! Status:%d\n", rtcRes); while( retry-- > 0 ) {
return FALSE; if( RTC_GetDateTime( &date, &time ) == RTC_RESULT_SUCCESS ) {
break;
}
OS_Sleep(1);
}
if( retry < 0 ) {
// RTCリードに失敗した場合でも、オールの値をセットして続行マルチスレッド動作時にRTCアクセスは失敗する可能性がある
MI_CpuClear8( &date, sizeof(RTCDate) );
MI_CpuClear8( &time, sizeof(RTCTime) );
} }
if( isLauncherError ) if( isLauncherError )