keil
#include "headfile.h"
uint8 i=0;
void TM4_Isr() interrupt 20
void main()
{
WTST = 0; //设置程序代码等待参数,赋值为0可将CPU执行程序的速度设置为最快
DisableGlobalIRQ(); //关闭总中断
sys_clk = 35000000; //设置系统频率为35MHz
board_init(); //初始化寄存器
//此处编写用户代码(例如:外设初始化代码等)
pit_timer_ms(TIM_4, 20); //使用TIMER作为周期中断,时间1ms一次
//进入1000次中断 翻转一次LED,也就是1000MS 翻转一次LED
P52=1;
//总中断最后开启
EnableGlobalIRQ(); //开启总中断
while(1)
{
if(P66==0){
delay_ms(20);
if(P66==0)
{while(!P66);}
i=i+1;P52=!P52;
}
if(P67==0){
delay_ms(20);
if(P67==0)
{while(!P67);}
i=i-1;P52=!P52;
}
}}
uint32 count = 0
void TM4_Isr() interrupt 20
{
TIM4_CLEAR_FLAG; //清除中断标志
if(count++ >= 50)
{
count = 0;
uart_putchar(DEBUG_UART,0X1E);
}
}
error C42: 'main': not in formal parameter list
..\USER\src\main.c(26): error C25: syntax error near '{'