static void init_timer(void) { //ʹÓÃÍⲿÖжϣ¬ÒªÏû¶¶£¡£¡£¡£¡
DisableInterrupts //¹ØÖжÏ
TSC = 0x70; //ÔÊÐíÖжϣ¬Í£Ö¹¼ÆÊý£¬¼ÆÊýÆ÷¸´Î»
TMODH = 153; //8ms²úÉúÒ»´ÎÒç³öÖжÏ
TMODL = 153;
EnableInterrupts; //¿ªÖжÏ
}
void interrupt 6 overflow_isr(void) {
TSC = 0x70; //ÇåÖжϱêÖ¾
byte_counter = 0;
romeoDriverState = ROMEO_READY;
semaphore = 1;
} |