📄 interrupt.c
字号:
#include "interrupt.h"
#include <can0h.h>
extern unsigned char uart0_reset_count;
void timer0_ovf_isr(void)
{
TCNT0 = 0xB2; //reload counter value
timeup++;
//---------------------------------------------------------------
if(sound_beep_count)sound_beep_count--;
if(uart_reset_count)uart_reset_count--;
if(uart0_reset_count)uart0_reset_count--;
//---------------------------------------------------------------
if(++second2_count>=50) //500ms
{
second2_count=0;
if(sound_alarm_count)sound_alarm_count--;
if(++bat_count==10)bat_count=0;
}
//---------------------------------------------------------------
if(++second_count>=100) //1s
{
second_count=0;
if(charge_time)
{
charge_time--;
if(time[2])time[2]--;
else
{
time[2]=59;
if(time[1])time[1]--;
else
{
time[1]=59;
if(time[0])time[0]--;
}
}
}
if(blight_count)blight_count--;
if(tips_count)tips_count--;
}
//---------------------
if(work_time_en)
{
work_time_counter++;
if(work_time_counter>20)
{
work_time_counter=0;
work_time_car++;
work_time_perid++;
};
};
//---------------------------------------------------------------
//if(timeup>1)
key_check();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -