📄 target board code
字号:
/************************************
生物医学信号目标板测试程序 V1.0
类别:主程序
作者:余泽峰
日期:2012-10-9
************************************/
#include "config.h"
void DelayMs(unsigned int ms)
{
unsigned int i;
while(ms--)
{
for(i=0;i<7200;i++);
}
}
/*************************
函数名称:LEDFlash
函数功能:LED灯闪烁
**************************/
void LEDFlash(void)
{
static BYTE tick;
if( tick != 0 ) //系统运行灯闪烁
{ GPIO_ResetBits(GPIOB,GPIO_Pin_6); }
else
{ GPIO_SetBits(GPIOB,GPIO_Pin_6); }
tick = !tick;
}
/*************************
函数名称:main
函数功能:主函数
**************************/
int main(void)
{
DelayMs(200); //开机延时,等待系统电源稳定
SystemInit(); //系统时钟初始化
initOnChipHal(); //片上外设初始化
initOffChipHal(); //片外设备初始化
SysTick_Config(SystemFrequency / 1000); //SysTick时钟中断 1ms
while(1)
{
if( f_timetask_int == 1 ) //5ms
{
f_timetask_int = 0;
}
if( f_timetask_ledflash == 1 )
{
LEDFlash();
f_timetask_ledflash = 0;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -