|
我重新核对问题后发现出厂前没有出现这个问题,都是运行一段时间后才出现,但是对FLASH的操作在出厂后就没有了,很困惑!下面这段程序是基本定时器中断程序,也就是中断向量开始的地方,请大家看看有什么问题
#pragma vector=BASICTIMER_VECTOR //基本定时器中断程序,秒中断
__interrupt void BASICTIME()
{
display_renew_time++; //显示更新时间+1
key_time++; //test key‘s delay
if(LCDCTL&LCDON)
displaytime++;//显示时间+1
if(display_instant_flux_flag==0x5a)
{
if(++display_instant_time>=5)
{
display_instant_flux_firstflag=0;
_BIC_SR_IRQ(LPM3_bits);
}
}
if(display_power_flag==0x5a)
{
if(++display_power_time>=30)
{
display_power_firstflag=0;
_BIC_SR_IRQ(LPM3_bits);
}
}
if(++second10>=60)
{
second10=0;
if(++minute10>=65) //分钟计数器+1
{
minute10=0;
hour_soft_flag=0x5a;//软件定时一小时标志
_BIC_SR_IRQ(LPM3_bits);
}
}
if(debug_flag==0x5a)// sample AD per 2 second when debuging
{
if(++debug_time>=2)
{
debug_time=0;
temperaturemesure_flag=0x5a; //置AD采样标识
_BIC_SR_IRQ(LPM3_bits); // Clear LPM3 bits from 0(SR)
}
}
else if(fluxing_flag==0x5a)
{
if(++basic_time>=10)//若5秒钟没有脉冲标志,即认为无脉冲
{
fluxing_flag=0;
temperaturemesure_flag=0x5a;//when flux stop,calculate flux and heat
_BIC_SR_IRQ(LPM3_bits);
}
else if(!(second10%30))//when fluxing test temperature once 30 second
{
temperaturemesure_flag=0x5a;
_BIC_SR_IRQ(LPM3_bits); // Clear LPM3 bits from 0(SR)
}
}
else if(!second10)
{
if(minute10>=2)
{
minute10=0;
temperaturemesure_flag=0x5a;
_BIC_SR_IRQ(LPM3_bits); //test temperature once 2 minute when no flux
}
}//
if(displaypoint!=0)
{
if(debug_flag==0x5a)
{
if(LCDMEM[0]&BIT0)//调试状态时“t"闪烁
guanceshi;
else
ceshi;
}
_BIC_SR_IRQ(LPM3_bits);
} |
|