#ifndef _MAIN_H_ #define _MAIN_H_ #include "type.h" // Change this comment to make Full/Low speed // SYSCLK frequency in Hz #define SYSCLK 24500000UL // System clock selections (SFR CLKSEL) #define SYS_INT_OSC 0x00 // Select to use internal oscillator #define SYS_4X_MUL 0x03 // Select to use internal oscillator #define SYS_EXT_OSC 0x01 // Select to use an external oscillator #define SYS_4X_DIV_2 0x02 extern volatile xdata u32 global_ms; extern volatile unsigned char state; #define STATE_LOG_ON 0x01 #define STATE_WRITTEN_LOG 0x02 #define CRITICAL_GLOBAL(func) \ { \ EA = 0; \ { \ func; \ } \ EA = 1; \ } #define ENDLINE "\r\n" #define ENDLINE_SGN '\r' void wait_10n4clk(u8 i); void wait_us(u16 count); void wait_ms(u16 count); #endif /* _MAIN_H_ */