forked from ccsens_hardware/stc_touch_pen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1016 B
44 lines
1016 B
#include "Time.h"
|
|
//#include "../bsp/bsp_led.h"
|
|
|
|
|
|
/*************************初始化定时器0*****************************/
|
|
// 定时器0
|
|
// 16位自动重载 15系列
|
|
// 12T (FOSC/12)
|
|
//由 stc-isp v6.86c 定时器计算器生成
|
|
//10微秒@11.0592MHz
|
|
void L0_timer0_Init(void) //10微秒@11.0592MHz
|
|
{
|
|
#if 0
|
|
AUXR &= 0x7F; //定时器时钟12T模式
|
|
TMOD &= 0xF0; //设置定时器模式
|
|
TL0 = 0x00; //设置定时初值
|
|
TH0 = 0xDC; //设置定时初值
|
|
TF0 = 0; //清除TF0标志
|
|
TR0 = 1; //定时器0开始计时
|
|
#else
|
|
AUXR &= 0x7F; //定时器时钟12T模式
|
|
TMOD &= 0xF0; //设置定时器模式
|
|
TL0 = 0x00; //设置定时初值
|
|
TH0 = 0x4C; //设置定时初值
|
|
TF0 = 0; //清除TF0标志
|
|
TR0 = 1; //定时器0开始计时
|
|
|
|
#endif
|
|
ET0 = 1; //add by cc
|
|
}
|
|
|
|
|
|
//10---87 10s
|
|
/********************** Timer0中断函数************************/
|
|
void timer0 (void) interrupt 1
|
|
{//
|
|
TF0 = 0;
|
|
L1_tick_tick();
|
|
}
|
|
|
|
/******************************END*********************************/
|
|
|
|
|
|
|
|
|