TwlIPL/build/libraries_sysmenu/sysmenu/ARM9/src/device.c
yosiokat d83aca47fe ・下記のAPIをSYSMからUTLライブラリに移動。
・ペアレンタルコントロールのマスターキー関係
 ・スリープ
・下記のAPIをSYSMから削除。
 ・バックライト輝度制御。
 ・無線LED制御。
・ランチャーの無線LED制御をPMi_SetWirelessLEDに変更。
・本体設定で、UTL_SetBacklightBrightnessを使用したバックライト輝度変更を追加。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@1457 b08762b0-b915-fc4b-9d8c-17b2551a87ff
2008-05-22 02:43:45 +00:00

74 lines
2.5 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*---------------------------------------------------------------------------*
Project: TwlIPL
File: SYSM_lib.c
Copyright 2007 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#include <twl.h>
#include <sysmenu.h>
#include <sysmenu/mcu.h>
#include <spi.h>
#include "internal_api.h"
// define data-----------------------------------------------------------------
// extern data-----------------------------------------------------------------
// function's prototype-------------------------------------------------------
// global variable-------------------------------------------------------------
// static variable-------------------------------------------------------------
// const data------------------------------------------------------------------
// ============================================================================
//
// デバイス制御
//
// ============================================================================
// RTCクロック補正値をセット
void SYSMi_WriteAdjustRTC( void )
{
RTCRawAdjust raw;
raw.adjust = LCFG_THW_GetRTCAdjust();
( void )RTCi_SetRegAdjust( &raw );
}
// 起動時のRTCチェック
void SYSMi_CheckRTC( void )
{
RTCDate date;
RTCTime time;
// RTCのリセット or おかしい値を検出した場合は初回起動シーケンスへ。
( void )RTC_GetDateTime( &date, &time );
if( !UTL_CheckRTCDate( &date ) ||
!UTL_CheckRTCTime( &time )
#ifndef __IS_DEBUGGER_BUILD // 青デバッガではRTCの電池がないので、毎回ここにひっかかって設定データが片方クリアされてしまう。これを防ぐスイッチ。
||
SYSMi_GetWork()->flags.common.isResetRTC
#endif
) { // RTCの異常を検出したら、rtc入力フラグrtcOffsetを0にしてNVRAMに書き込み。
OS_TPrintf("\"RTC reset\" or \"Illegal RTC data\" detect!\n");
LCFG_TSD_SetRTCOffset( 0 );
LCFG_TSD_SetRTCLastSetYear( 0 );
{
u8 *pBuffer = SYSM_Alloc( LCFG_WRITE_TEMP );
if( pBuffer != NULL ) {
LCFG_WriteTWLSettings( (u8 (*)[ LCFG_WRITE_TEMP ] )pBuffer );
SYSM_Free( pBuffer );
}
}
}
}