From 25cea2f0f20541665d15e6587e5eb542a60bb47a Mon Sep 17 00:00:00 2001 From: shirait Date: Fri, 15 Jun 2007 12:13:00 +0000 Subject: [PATCH] small fix git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@121 4ee2a332-4b2b-5046-8439-1ba90f034370 --- build/libraries/devices/sdmc/ARM7/sdmc.c | 9 ++-- build/tests/fatfs/fatfs_sd/ARM7/Makefile | 2 +- build/tests/fatfs/fatfs_sd/ARM9/Makefile | 41 +++++++++++++++ build/tests/fatfs/fatfs_sd/ARM9/src/main.c | 59 ++++++++++++++++++++++ 4 files changed, 105 insertions(+), 6 deletions(-) create mode 100644 build/tests/fatfs/fatfs_sd/ARM9/Makefile create mode 100644 build/tests/fatfs/fatfs_sd/ARM9/src/main.c diff --git a/build/libraries/devices/sdmc/ARM7/sdmc.c b/build/libraries/devices/sdmc/ARM7/sdmc.c index a7a8c57..d973cfb 100644 --- a/build/libraries/devices/sdmc/ARM7/sdmc.c +++ b/build/libraries/devices/sdmc/ARM7/sdmc.c @@ -30,7 +30,7 @@ ***********************************************************************/ #define SD_STACK_SIZE (4096*2) #define SD_THREAD_PRIO (10) -#define SD_INTR_THREAD_PRIO (SD_THREAD_PRIO - 1) +#define SD_INTR_THREAD_PRIO (SD_THREAD_PRIO + 1) #define SD_OPERATION_INIT (0) #define SD_OPERATION_READ (1) @@ -520,6 +520,7 @@ SDMC_ERR_CODE sdmcInit(void (*func1)(),void (*func2)()) /* SD割り込み処理スレッドの立ち上げ */ + (void)OS_ClearIrqCheckFlag( OS_IE_SD); OS_CreateThread( &sdmc_intr_tsk, SDCARD_Intr_Thread, NULL, (sd_intr_stack+SD_STACK_SIZE / sizeof(u64)), SD_STACK_SIZE, SD_INTR_THREAD_PRIO); OS_WakeupThreadDirect( &sdmc_intr_tsk); @@ -575,7 +576,7 @@ SDMC_ERR_CODE sdmcGoIdle( void (*func1)(),void (*func2)()) /* 返り値待ち */ OS_ReceiveMessage( &sdmc_result_dtq, &init_msg, OS_MESSAGE_BLOCK); - api_result = *(SDMC_ERR_CODE*)init_msg; + api_result = (SDMC_ERR_CODE)init_msg; #endif /*----------------------------------*/ @@ -832,7 +833,6 @@ PRINTDEBUG( "SD_INFO1_MASK : 0x%x\n", (*(vu32 *)(SD_IP_BASE + 0x20)));*/ #if TIMEOUT SDCARD_TimerStart(SDCARD_INITIAL_TIMEOUT); /* タイムアウト判定用タイマスタート */ #endif -PRINTDEBUG( "%d\n", __LINE__); SD_SendCID(); /* CMD2発行 レスポンス確認 */ if(SDCARD_ErrStatus){ /* エラーステータスの確認(エラー有り?) */ @@ -850,7 +850,6 @@ PRINTDEBUG( "%d\n", __LINE__); } /*------- standby state -------*/ -PRINTDEBUG( "%d\n", __LINE__); SD_SendCSD(); /* CMD9発行 レスポンス確認 */ if(SDCARD_ErrStatus){ /* エラーステータスの確認(エラー有り?) */ return SDCARD_ErrStatus; @@ -880,7 +879,6 @@ PRINTDEBUG( "%d\n", __LINE__); #if SCR SD_SelectBitWidth(FALSE); /* CMD55->ACMD6 ビット幅の選択 1bit */ -PRINTDEBUG( "%d\n", __LINE__); /* ACMD51 発行 SD configuration register (SCR) */ if(SDCARD_SDFlag){ /* SDカードフラグ ON かチェック */ @@ -1737,6 +1735,7 @@ static u16 i_sdmcSendSCR(void) thread_flag = FALSE; while(!SDCARD_EndFlag){ /* カードアクセス終了待ち */ + PRINTDEBUG( "k\n"); if(SDCARD_ErrStatus & SDMC_ERR_FPGA_TIMEOUT){ /* タイムアウトエラーか確認 */ return SDCARD_ErrStatus; } diff --git a/build/tests/fatfs/fatfs_sd/ARM7/Makefile b/build/tests/fatfs/fatfs_sd/ARM7/Makefile index 59abbd8..5a82777 100644 --- a/build/tests/fatfs/fatfs_sd/ARM7/Makefile +++ b/build/tests/fatfs/fatfs_sd/ARM7/Makefile @@ -34,7 +34,7 @@ INCDIR += $(TWLSDK_ROOT)/include/twl \ LLIBRARY_DIRS = $(TWLSDK_ROOT)/lib/ARM-BB/Release LLIBRARIES = libfatfs_sp.twl.a \ - libromsd_sp.twl.a \ + libsd_sp.twl.a \ #SRCDIR = # using default #LCFILE = # using default diff --git a/build/tests/fatfs/fatfs_sd/ARM9/Makefile b/build/tests/fatfs/fatfs_sd/ARM9/Makefile new file mode 100644 index 0000000..c5404f3 --- /dev/null +++ b/build/tests/fatfs/fatfs_sd/ARM9/Makefile @@ -0,0 +1,41 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - CAMERA - demos - camera-1 +# File: Makefile +# +# 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. +# +# $Log: Makefile,v $ +# $NoKeywords: $ +#---------------------------------------------------------------------------- + +SUBDIRS = + + +#---------------------------------------------------------------------------- + +#TWL_CODEGEN = THUMB + +TARGET_BIN = main.axf + +SRCS = main.c + +#SRCDIR = # using default +#LCFILE = # using default + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/tests/fatfs/fatfs_sd/ARM9/src/main.c b/build/tests/fatfs/fatfs_sd/ARM9/src/main.c new file mode 100644 index 0000000..7a100f1 --- /dev/null +++ b/build/tests/fatfs/fatfs_sd/ARM9/src/main.c @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - SND - demos - capture + File: main.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. + + $Log: main.c,v $ + $NoKeywords: $ + *---------------------------------------------------------------------------*/ + +#include + +static void VBlankIntr(void); + +/*---------------------------------------------------------------------------* + Name: TwlMain + + Description: main + + Arguments: None + + Returns: None + *---------------------------------------------------------------------------*/ +void TwlMain() +{ + // 初期化 + OS_Init(); + GX_Init(); + OS_InitTick(); + + // Vブランク割り込み設定 + OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)OS_EnableIrq(); + (void)GX_VBlankIntr(TRUE); + { + u16 bg_color = GX_RGB(31, 0, 0); + GX_LoadBGPltt(&bg_color, 0, sizeof(u16)); + } + + while (1) + { + OS_WaitVBlankIntr(); + } +} + +//-------------------------------------------------------------------------------- +// Vブランク割り込み処理 +// +void VBlankIntr(void) +{ + OS_SetIrqCheckFlag(OS_IE_V_BLANK); // checking VBlank interrupt +}