diff --git a/build/tests/os/Makefile b/build/tests/os/Makefile index 11093b5..9cbfef5 100644 --- a/build/tests/os/Makefile +++ b/build/tests/os/Makefile @@ -24,6 +24,7 @@ SUBDIRS = alarm-1 \ sleep-1 \ svc-rsa \ svc-sha1 \ + debugLED \ #---------------------------------------------------------------------------- diff --git a/build/tests/os/debugLED/ARM7/Makefile b/build/tests/os/debugLED/ARM7/Makefile new file mode 100644 index 0000000..df38b29 --- /dev/null +++ b/build/tests/os/debugLED/ARM7/Makefile @@ -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 ===== diff --git a/build/tests/os/debugLED/ARM7/src/main.c b/build/tests/os/debugLED/ARM7/src/main.c new file mode 100644 index 0000000..8e41020 --- /dev/null +++ b/build/tests/os/debugLED/ARM7/src/main.c @@ -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 + +/*---------------------------------------------------------------------------* + 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(); +} diff --git a/build/tests/os/debugLED/ARM9/Makefile b/build/tests/os/debugLED/ARM9/Makefile new file mode 100644 index 0000000..1a74b1a --- /dev/null +++ b/build/tests/os/debugLED/ARM9/Makefile @@ -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 ===== diff --git a/build/tests/os/debugLED/ARM9/src/main.c b/build/tests/os/debugLED/ARM9/src/main.c new file mode 100644 index 0000000..b441d05 --- /dev/null +++ b/build/tests/os/debugLED/ARM9/src/main.c @@ -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 + +//================================================================================ +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(); +} diff --git a/build/tests/os/debugLED/Makefile b/build/tests/os/debugLED/Makefile new file mode 100644 index 0000000..078ec37 --- /dev/null +++ b/build/tests/os/debugLED/Makefile @@ -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 =====