📄 main.c
字号:
/****************************************Copyright (c)**************************************************
** Guangzou ZLG-MCU Development Co.,LTD.
** graduate school
** http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name: main.c
** Last modified Date: 2004-09-16
** Last Version: 1.0
** Descriptions: The main() function example template
**
**------------------------------------------------------------------------------------------------------
** Created by: Chenmingji
** Created date: 2004-09-16
** Version: 1.0
** Descriptions: The original version
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
** 说明:
**
********************************************************************************************************/
#include "config.h"
/*
*********************************************************************************************************
** 函数名称 :DelayNS()
** 函数功能 :长软件延时
** 入口参数 :dly 延时参数,值越大,延时越久
** 出口参数 :无
*********************************************************************************************************
*/
void DelayNS (uint32 dly)
{
uint32 i;
for ( ; dly>0; dly--)
for (i=0; i<50000; i++);
}
/*
*********************************************************************************************************
** 函数名称 :main()
** 函数功能 :用P1.27控制BEEP,让BEEP鸣叫。
** 调试说明 :需将跳线JP21短接。
*********************************************************************************************************
*/
#define BEEP (1<<27)
int main (void)
{
while (1)
{
BUZZER_Set();// BEEP 蜂鸣
DelayNS(50);
BUZZER_Clr();// BEEP停止蜂鸣
DelayNS(50);
}
return 0;
}
/*********************************************************************************************************
** End Of File
********************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -