tmrtest.c
来自「NXP产品LPC23XX的开发板的源文件」· C语言 代码 · 共 55 行
C
55 行
/*****************************************************************************
* tmrtest.c: main C entry file for NXP LPC23xx/24xx Family Microprocessors
*
* Copyright(C) 2006, NXP Semiconductor
* All rights reserved.
*
* History
* 2006.09.01 ver 1.00 Prelimnary version, first Release
*
******************************************************************************/
#include "LPC230x.H" /* LPC23xx/24xx definitions */
#include "type.h"
#include "target.h"
#include "irq.h"
#include "timer.h"
extern volatile DWORD timer_counter;
/*****************************************************************************
** Main Function main()
*****************************************************************************/
int main (void)
{
DWORD counter = 0;
TargetResetInit();
FIO2DIR = 0x000000FF; /* P1.16..23 defined as Outputs */
FIO2CLR = 0x000000FF; /* turn off all the LEDs */
init_timer( TIME_INTERVAL );
enable_timer( 0 );
while (1)
{ /* Loop forever */
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 + =
减小字号Ctrl + -
显示快捷键?