?? pmtest.c
字號:
/*****************************************************************************
* pmtest.c: main C entry file for NXP LPC23xx/24xx Family Microprocessors
*
* Copyright(C) 2006, NXP Semiconductor
* All rights reserved.
*
* History
* 2006.07.20 ver 1.00 Prelimnary version, first Release
*
******************************************************************************/
#include "LPC230x.h" /* LPC23xx/24xx definitions */
#include "type.h"
#include "irq.h"
#include "target.h"
#include "timer.h"
#include "pwrman.h"
extern volatile DWORD timer_counter;
/******************************************************************************
** Main Function main()
******************************************************************************/
int main (void)
{
DWORD counter = 0;
TargetResetInit();
FIO2DIR = 0x000000FF; /* P2.0..7 defined as Outputs */
FIO2CLR = 0x000000FF; /* turn off all the LEDs */
init_timer( TIME_INTERVAL );
enable_timer( 0 );
if ( PM_Init( ) != TRUE )
{
while( 1 ); /* fatal error */
}
/* After setting up the wake up source, go to power down mode,
when the push button on EXTINT0 is pressed, the system will wake
up, Reset_MainClock() will be the first routine to be executed,
the PLL will be reconfigured, finally, LEDs are blinking happily. */
PCON = 0x2;
ConfigurePLL();
counter = 0;
timer_counter = 0;
while ( 1 )
{
if ( timer_counter >= (0x20 * counter) )
{
FIO2SET = 1 << counter;
counter++;
if ( counter > 8 )
{
counter = 0;
timer_counter = 0;
FIO2CLR = 0x000000FF;
}
}
}
return 0;
}
/******************************************************************************
** End Of File
******************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -