mirror of
https://github.com/rvtr/twl_wrapsdk.git
synced 2025-10-31 06:11:10 -04:00
small fix
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@121 4ee2a332-4b2b-5046-8439-1ba90f034370
This commit is contained in:
parent
070acee11b
commit
25cea2f0f2
@ -30,7 +30,7 @@
|
|||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
#define SD_STACK_SIZE (4096*2)
|
#define SD_STACK_SIZE (4096*2)
|
||||||
#define SD_THREAD_PRIO (10)
|
#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_INIT (0)
|
||||||
#define SD_OPERATION_READ (1)
|
#define SD_OPERATION_READ (1)
|
||||||
@ -520,6 +520,7 @@ SDMC_ERR_CODE sdmcInit(void (*func1)(),void (*func2)())
|
|||||||
|
|
||||||
|
|
||||||
/* SD割り込み処理スレッドの立ち上げ */
|
/* SD割り込み処理スレッドの立ち上げ */
|
||||||
|
(void)OS_ClearIrqCheckFlag( OS_IE_SD);
|
||||||
OS_CreateThread( &sdmc_intr_tsk, SDCARD_Intr_Thread, NULL,
|
OS_CreateThread( &sdmc_intr_tsk, SDCARD_Intr_Thread, NULL,
|
||||||
(sd_intr_stack+SD_STACK_SIZE / sizeof(u64)), SD_STACK_SIZE, SD_INTR_THREAD_PRIO);
|
(sd_intr_stack+SD_STACK_SIZE / sizeof(u64)), SD_STACK_SIZE, SD_INTR_THREAD_PRIO);
|
||||||
OS_WakeupThreadDirect( &sdmc_intr_tsk);
|
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);
|
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
|
#endif
|
||||||
/*----------------------------------*/
|
/*----------------------------------*/
|
||||||
|
|
||||||
@ -832,7 +833,6 @@ PRINTDEBUG( "SD_INFO1_MASK : 0x%x\n", (*(vu32 *)(SD_IP_BASE + 0x20)));*/
|
|||||||
#if TIMEOUT
|
#if TIMEOUT
|
||||||
SDCARD_TimerStart(SDCARD_INITIAL_TIMEOUT); /* タイムアウト判定用タイマスタート */
|
SDCARD_TimerStart(SDCARD_INITIAL_TIMEOUT); /* タイムアウト判定用タイマスタート */
|
||||||
#endif
|
#endif
|
||||||
PRINTDEBUG( "%d\n", __LINE__);
|
|
||||||
|
|
||||||
SD_SendCID(); /* CMD2発行 レスポンス確認 */
|
SD_SendCID(); /* CMD2発行 レスポンス確認 */
|
||||||
if(SDCARD_ErrStatus){ /* エラーステータスの確認(エラー有り?) */
|
if(SDCARD_ErrStatus){ /* エラーステータスの確認(エラー有り?) */
|
||||||
@ -850,7 +850,6 @@ PRINTDEBUG( "%d\n", __LINE__);
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*------- standby state -------*/
|
/*------- standby state -------*/
|
||||||
PRINTDEBUG( "%d\n", __LINE__);
|
|
||||||
SD_SendCSD(); /* CMD9発行 レスポンス確認 */
|
SD_SendCSD(); /* CMD9発行 レスポンス確認 */
|
||||||
if(SDCARD_ErrStatus){ /* エラーステータスの確認(エラー有り?) */
|
if(SDCARD_ErrStatus){ /* エラーステータスの確認(エラー有り?) */
|
||||||
return SDCARD_ErrStatus;
|
return SDCARD_ErrStatus;
|
||||||
@ -880,7 +879,6 @@ PRINTDEBUG( "%d\n", __LINE__);
|
|||||||
|
|
||||||
#if SCR
|
#if SCR
|
||||||
SD_SelectBitWidth(FALSE); /* CMD55->ACMD6 ビット幅の選択 1bit */
|
SD_SelectBitWidth(FALSE); /* CMD55->ACMD6 ビット幅の選択 1bit */
|
||||||
PRINTDEBUG( "%d\n", __LINE__);
|
|
||||||
|
|
||||||
/* ACMD51 発行 SD configuration register (SCR) */
|
/* ACMD51 発行 SD configuration register (SCR) */
|
||||||
if(SDCARD_SDFlag){ /* SDカードフラグ ON かチェック */
|
if(SDCARD_SDFlag){ /* SDカードフラグ ON かチェック */
|
||||||
@ -1737,6 +1735,7 @@ static u16 i_sdmcSendSCR(void)
|
|||||||
thread_flag = FALSE;
|
thread_flag = FALSE;
|
||||||
|
|
||||||
while(!SDCARD_EndFlag){ /* カードアクセス終了待ち */
|
while(!SDCARD_EndFlag){ /* カードアクセス終了待ち */
|
||||||
|
PRINTDEBUG( "k\n");
|
||||||
if(SDCARD_ErrStatus & SDMC_ERR_FPGA_TIMEOUT){ /* タイムアウトエラーか確認 */
|
if(SDCARD_ErrStatus & SDMC_ERR_FPGA_TIMEOUT){ /* タイムアウトエラーか確認 */
|
||||||
return SDCARD_ErrStatus;
|
return SDCARD_ErrStatus;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ INCDIR += $(TWLSDK_ROOT)/include/twl \
|
|||||||
|
|
||||||
LLIBRARY_DIRS = $(TWLSDK_ROOT)/lib/ARM-BB/Release
|
LLIBRARY_DIRS = $(TWLSDK_ROOT)/lib/ARM-BB/Release
|
||||||
LLIBRARIES = libfatfs_sp.twl.a \
|
LLIBRARIES = libfatfs_sp.twl.a \
|
||||||
libromsd_sp.twl.a \
|
libsd_sp.twl.a \
|
||||||
|
|
||||||
#SRCDIR = # using default
|
#SRCDIR = # using default
|
||||||
#LCFILE = # using default
|
#LCFILE = # using default
|
||||||
|
|||||||
41
build/tests/fatfs/fatfs_sd/ARM9/Makefile
Normal file
41
build/tests/fatfs/fatfs_sd/ARM9/Makefile
Normal file
@ -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 =====
|
||||||
59
build/tests/fatfs/fatfs_sd/ARM9/src/main.c
Normal file
59
build/tests/fatfs/fatfs_sd/ARM9/src/main.c
Normal file
@ -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 <twl.h>
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user