在线时间99 小时
UID1893765
注册时间2012-12-1
NXP金币0
TA的每日心情 | 开心 2019-4-28 12:41 |
---|
签到天数: 2 天 连续签到: 1 天 [LV.1]初来乍到
高级会员

- 积分
- 802
- 最后登录
- 2021-9-5
|
自己新建的工程,keil 5.15版本功能led等交替闪烁
/*
* @brief Blinky example using sysTick
*
* @note
* Copyright(C) NXP Semiconductors, 2013
* All rights reserved.
*
* @par
* Software that is described herein is for illustrative purposes only
* which provides customers with programming information regarding the
* LPC products. This software is supplied "AS IS" without any warranties of
* any kind, and NXP Semiconductors and its licensor disclaim any and
* all warranties, express or implied, including all implied warranties of
* merchantability, fitness for a particular purpose and non-infringement of
* intellectual property rights. NXP Semiconductors assumes no responsibility
* or liability for the use of the software, conveys no license or rights under any
* patent, copyright, mask work right, or any other intellectual property rights in
* or to any products. NXP Semiconductors reserves the right to make changes
* in the software without notification. NXP Semiconductors also makes no
* representation or warranty that such application will be suitable for the
* specified use without further testing or modification.
*
* @par
* Permission to use, copy, modify, and distribute this software and its
* documentation is hereby granted, under NXP Semiconductors' and its
* licensor's relevant copyrights in the software, without fee, provided that it
* is used in conjunction with NXP Semiconductors microcontrollers. This
* copyright, permission, and disclaimer notice must appear in all copies of
* this code.
*/
#include "board.h"
#include <stdio.h>
#include "stopwatch.h"
/*****************************************************************************
* Private types/enumerations/variables
****************************************************************************/
#define TICKRATE_HZ1 (1000) /* 10 ticks per second */
#define SDRAM_START_ADDRESS 0x28000000
/*****************************************************************************
* Public types/enumerations/variables
****************************************************************************/
/*****************************************************************************
* Private functions
****************************************************************************/
/*****************************************************************************
* Public functions
****************************************************************************/
/**
* @brief Handle interrupt from SysTick timer
* @return Nothing
*/
void SysTick_Handler(void)
{
static int x = 0;
if (x++ > 500) {
Board_LED_Toggle(0);
Board_LED_Toggle(1);
x = 0;
}
}
/* Set up and initialize all required blocks and functions related to the
board hardware */
void Board_Init(void)
{
/* Sets up DEBUG UART */
DEBUGINIT();
/* Initializes GPIO */
Chip_GPIO_Init(LPC_GPIO_PORT);
/* Initialize LEDs */
Board_LED_Init();
}
/**
* @brief main routine for blinky example
* @return Function should not exit.
*/
int main(void)
{
SystemCoreClockUpdate();
Board_Init();
/* Enable and setup SysTick Timer at a periodic rate */
SysTick_Config(SystemCoreClock / TICKRATE_HZ1);
while (1) {
__WFI();
}
return 0;
}
|
评分
-
查看全部评分
|