#include<msp430x44x.h> volatile int tick=0;//被不同线程访问 void main(void) {WDTCTL=WDTPW+WDTHOLD;//关看门狗 IE2=BTIE;//使能基本定时器中断 BTCTL=BTSSEL+BT_fCLK2_DIV256;//设置控制寄存器 _EINT();//使能中断指令ENIT后面的指令总会被执行,中断请求悬而未决的时间也能执行 while(1) { if(tick==327) { tick=0; } } } #pragma vector=BASICTIMER_VECTOR _interrupt void BasicTimerInt(void)//基本定时器中断 { tick+=1; }
调试信息
main.c Error[Pe077]: this declaration has no storage class or type specifier E:\MSPTEST449\simulator_BasicTimerInt\main.c 17 Warning[Pe609]: this kind of pragma may not be used here E:\MSPTEST449\simulator_BasicTimerInt\main.c 16 Error[Pe065]: expected a ";" E:\MSPTEST449\simulator_BasicTimerInt\main.c 17 Warning[Pe012]: parsing restarts here after previous syntax error E:\MSPTEST449\simulator_BasicTimerInt\main.c 20 Error while running C/C++ compiler Done. 2 error(s), 2 warning(s)
|