twl_wrapsdk/build/tests/os/sleep-1/ARM9/src/main.c
yutaka 11e95b591c add a test for OS_Sleep.
CDC is using OS_Sleep again and tests are fixed.

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@184 4ee2a332-4b2b-5046-8439-1ba90f034370
2007-07-10 00:54:50 +00:00

61 lines
1.5 KiB
C

/*---------------------------------------------------------------------------*
Project: NitroSDK - OS - demos - sleep-1
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()
{
u16 trg;
u16 old = 0;
OS_Init();
OS_Printf("ARM9 starts.\n");
OS_InitTick();
OS_InitAlarm();
OS_EnableIrq();
while (1)
{
u16 pad = PAD_Read();
trg = (u16)(pad & ~old);
old = pad;
if (trg & PAD_BUTTON_A)
{
OS_TPrintf("call OS_Sleep(1000) ...");
OS_Sleep(1000);
OS_TPrintf(" Done.\n");
}
if (trg & PAD_BUTTON_START)
{
break;
}
}
// done
OS_TPrintf("\nARM9 ends.\n");
OS_Terminate();
}