/*----------------------------*/ /* Include Header File */ /*----------------------------*/ #include "stc32.h" /* stc32 register address define and function prototype*/ #include "math.h" /*----------------------------*/ /* Global variable definition */ /*----------------------------*/ int TICK=0, TICK0=0, TICK1=0; int LED=0; int rear_i = -1, front_i = -1; int rear_o = -1, front_o = -1; char queue_i[ MAXQ ]; char queue_o[ MAXQ ]; int rear_KBD = -1, front_KBD = -1; char queue_KBD[ MAXKBD ]; char KBD_old[] = { 0, 0, 0, 0 }; int KBD_cnt = 0; char KBD_T1[] = "FEDCB369A2580147"; char PORTC_REG = 0; int rear_LCD = -1, front_LCD = -1; char queue_LCD[ MAXLCD ]; int bias[] = { 0, 0 }; real SCALAR[] = { 1.0, 1.0 }; int ain[2]; float ainf[2]; int flag = 0; int Flag =0; char cmd, keybd,str[20]; int temp, axis = 0; int count=0; int temp1; int m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};//last day of month int year=2001,month=9,date=20,hour=18,min=51,sec=2;//set start timer char DATA[31],DATA1[10]; void main() { stc32_init(); settimer1freq(10000); inittimer1isr(); }//main /*====================================*/ /* Begin of ISR */ /* -------------------------------------------- */ /* External Hardware Interrupt /INT2 User defined ISR -------------------------------------------- */ void c_int02() { count++; asm("\tNOP"); asm("\tNOP"); } /* -------------------------------------------- */ /* External Hardware Interrupt /INT3 User defined ISR -------------------------------------------- */ void c_int03() // 8.3333 KHz { TICK++; asm("\tNOP"); asm("\tNOP"); } /*-----------------------------------------------------*/ /* Timer 0 Interrupt, Frequency 1kHz (100kHz<=>10usec) */ /*-----------------------------------------------------*/ /* --------------------------------------------- */ /* Timer1 for user */ /* Timer1 is set by settimer1freq( Freq1 ); inittimer1isr(); */ /* --------------------------------------------- */ void c_int08() { TICK1++; get_adc(ain); set_dac_cdm(0,aing[0]); asm("\tNOP"); asm("\tNOP"); } /* End of ISR */