add debugLED sample

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@259 4ee2a332-4b2b-5046-8439-1ba90f034370
This commit is contained in:
yutaka 2007-08-29 06:26:29 +00:00
parent 6f6064837b
commit 516a867c68
6 changed files with 215 additions and 0 deletions

View File

@ -24,6 +24,7 @@ SUBDIRS = alarm-1 \
sleep-1 \
svc-rsa \
svc-sha1 \
debugLED \
#----------------------------------------------------------------------------

View File

@ -0,0 +1,44 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlSDK - OS - demos - debugLED
# 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: $
# $NoKeywords: $
#----------------------------------------------------------------------------
SUBDIRS =
#----------------------------------------------------------------------------
#TWL_CODEGEN = THUMB
TWL_PROC = ARM7
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 =====

View File

@ -0,0 +1,45 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - OS - demos - debugLED
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>
/*---------------------------------------------------------------------------*
Name: TwlMain
Description: main
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void TwlMain()
{
int i;
OS_Init();
OS_Printf("ARM7 starts.\n");
OS_InitDebugLED();
for (i = 0; i < 0x100; i++)
{
OS_SetDebugLED((u8)i);
SVC_WaitByLoop(0x20000);
}
// done
OS_TPrintf("\nARM7 ends.\n");
OS_Terminate();
}

View File

@ -0,0 +1,43 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlSDK - OS - demos - debugLED
# 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: $
# $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 =====

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - OS - demos - debugLED
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 dump(const char *str, void *ptr, u32 length)
{
u8 *data = (u8*)ptr;
int i;
OS_TPrintf("\n[%s] (%d bytes):\n\t", str, length);
for (i = 0; i < length; i++) {
OS_TPrintf("%02X", *data++);
if ((i & 0xF) == 0xF) OS_TPrintf("\n\t");
else OS_TPrintf(" ");
}
OS_TPrintf("\n");
}
/*---------------------------------------------------------------------------*
Name: TwlMain
Description: main
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void TwlMain()
{
OS_Init();
OS_Printf("ARM9 starts.\n");
// done
OS_TPrintf("\nARM9 ends.\n");
OS_Terminate();
}

View File

@ -0,0 +1,32 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlSDK - build
# 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: $
# $NoKeywords: $
#----------------------------------------------------------------------------
include $(TWLSDK_ROOT)/build/buildtools/commondefs
#----------------------------------------------------------------------------
SUBDIRS = \
ARM7 \
ARM9 \
#----------------------------------------------------------------------------
include $(TWLSDK_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====