/*----------------------------*/ /* 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; void main() { stc32_init(); while(1) { while( (cmd=rs232_in() )==0); switch(cmd) { case 'a': case 'A': LCD_flush(); LCD_HOME0(); get_adc(ain); string2LCD("AD_CH0="); ltoa((long)ain[0],str); string2LCD(str); break; }//switch }//while }//main /*====================================*/ /* Begin of ISR */ /* -------------------------------------------- */ /* External Hardware Interrupt /INT2 User defined ISR -------------------------------------------- */ void c_int02() { 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++; asm("\tNOP"); asm("\tNOP"); } /* End of ISR */