
// * 函数定时中断修饰
#define MACRO_TIMER_TICK interrupt 200 [#.MEGA8.WATCH.TIM1_COMPA]

// * 打开中断定时响应
#define MACRO_TIMER_ON() #.MEGA8.TIMSK | 0b0001_0000

// * 关闭定时中断响应
#define MACRO_TIMER_OFF() #.MEGA8.TIMSK & 0b1110_1111

	//---------------------------------------------------
	//定时器初始化
	void TimerInit()
	{
		#.MEGA8.TCCR1A = 0B0000_0000;
		#.MEGA8.TCCR1B = 0B0000_1001;
		
		uint16 t = 8000;
		#.MEGA8.OCR1AH = t.8(uint8);
		#.MEGA8.OCR1AL = t.0(uint8);
		
		MACRO_TIMER_ON();
	}

