/*---------------------------------------------------------------------------* Project: TwlIPL File: pxi.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 #include #include #include #include "internal_api.h" #ifdef SDK_ARM7 #include #endif // SDK_ARM7 // define data----------------------------------------------------------------- #define SYSM_PXI_COMM_STAT_REQ 0 #define SYSM_PXI_COMM_STAT_ACK 1 // PXIコマンド typedef union SYSMPXIPacket { struct { u16 data; u8 cmd; // PXI_FIFOMESSAGE_BITSZ_DATA = 26 u8 stat : 2; }; u32 raw; }SYSMPXIPacket; // extern data----------------------------------------------------------------- // function's prototype------------------------------------------------------- // global variable------------------------------------------------------------- // static variable------------------------------------------------------------- static volatile BOOL s_sending[SYSM_PXI_COMM_NUM]; // const data------------------------------------------------------------------ // PXI初期化 #ifdef SDK_ARM9 void SYSM_InitPXI( void ) #else // SDK_ARM7 void SYSM_InitPXI( u32 mcu_prio ) #endif // SDK_ARM7 { static BOOL isInitialized; int i; if (isInitialized) { return; } isInitialized = TRUE; // マイコンPXI初期化とマイコンバージョン取得 #ifdef SDK_ARM9 SYSM_InitMcuPxi(); #else // SDK_ARM7 SYSM_InitMcuPxi( mcu_prio ); #endif // SDK_ARM7 for (i=0; iflags.arm9.isEnableHotSW = 0; break; default: break; } }else { // SYSM_PXI_COMM_STAT_REQ switch( data ) { default: break; } } #else // !SDK_ARM9 if( packet.stat == SYSM_PXI_COMM_STAT_REQ ) { switch( data ) { case SYSM_PXI_COMM_DISABLE_HOTSW: if( SYSMi_GetWork()->flags.arm7.isBusyHotSW ) { SYSMi_GetWork()->flags.arm7.disableHotSW_REQ = 1; }else { SYSMi_GetWork()->flags.arm7.isEnableHotSW = 0; // PXIで返信 } break; default: break; } }else { // SYSM_PXI_COMM_STAT_ACK switch( data ) { default: break; } } #endif // SDK_ARM9 #endif }