/******************************************************************************************************************* *File Name : Timer0.h *Description : the file include test the timer0 function. *Date : 2008/06/03 *Author : yuanguiyou --History: ------------------------------------------------------------------------------------------------------------------ *change info: *******************************************************************************************************************/ #include "timer0.h" #include #include void IsrTimer0(void) { static uint8_t ucflag = 0; if (ucflag == 0) { PORTB = 0xFE; } else { PORTB = 0xFF; } ucflag = !ucflag; } int main(void) { PORTB = 0xFF; DDRB = 0xFF; Timer0Ioctl(IOCTL_SET_TIMER_ISR,(void*)&IsrTimer0); Timer0Init(); while(1) { } return 0; }