/************************************************************************************************** * MAIN PROGRAM **************************************************************************************************/ void main() { /*SDA_pin_out = 1; // Start the test example while(1) // Endless loop { //Read_SHT11(&temperature, &rel_humidity); Transmit_results(); Delay_ms(800); // delay 800ms }*/ Init_MCU(); // Initialize the MCU while(1) { if (User_Button == 0) { // If PORTD.B0 is pressed : UART6_Write_Text("EchoTest\r"); // send text string Delay_ms(250); // wait for 250ms } if(Received){ // If data is received via UART : LED_RED = 1; Delay_Ms(1000); LED_RED = 0; Received = 0; // clear received data flag Delay_ms(250); // wait for 250ms } } }
void Start_TP() { Init_MCU(); InitializeTouchPanel(); // You can get calibration constants using touch panel calibration example TP_TFT_Set_Calibration_Consts(76, 907, 77, 915); // Set calibration constants } //initalize variables on startup
void Start_TP() { Init_MCU(); InitializeTouchPanel(); // You can get calibration constants using touch panel calibration example TP_TFT_Set_Calibration_Consts(76, 907, 77, 915); // Set calibration constants InitializeObjects(); display_width = Screen1.Width; display_height = Screen1.Height; DrawScreen(&Screen1); }
void Start_TP() { Init_MCU(); InitializeTouchPanel(); // Delay_ms(1000); // TFTIntern_Fill_Screen(0); CalibrateIntern(); // TFTIntern_Fill_Screen(0); InitializeObjects(); display_width = HomeScreen.Width; display_height = HomeScreen.Height; DrawScreen(&HomeScreen); }
void Start_TP() { Init_MCU(); InitializeTouchPanel(); Delay_ms(1000); TFT_Fill_Screen(0); Calibrate(); TFT_Fill_Screen(0); InitializeObjects(); display_width = Screen1.Width; display_height = Screen1.Height; DrawScreen(&Screen1); }
/********************************* * 主函数 **********************************/ void main() { //uchar i; Init_IO(); //I/O口初始化, Init_MCU(); //主函数初始化,T0定时器工作在方式1初始化,显示"请稍等,初始化中",GATE=0, Init_RAM(); //位变量初始化 Init_Para(); //参数初始化,初始化参数,从IIC读取阈值等信息赋予给参量 Init_Buf(); //并口通讯数组初始化 // Select_Mast(); //判断主从机 Init_Time0(); //开启定时器0。定时器0初始化,工作在方式一,定时初值:H:0xDC,L:0x00;中断计数初始化?定时5ms,NumT0=0; Lcd_Clear(); //LCD清屏 Lcd_Start(); //显示"清华大学/n核能与新能源技术研究院" EX0=1; //只允许外部0中断,中断0为键盘 IT0=1; //外部中断0 while(1) { // BackUp_Display(); Select_Mast(); //判断主从机,写入主从机标志Flag_Mast=1(主机)0(从机) key_function(); //按键功能,在while循环中不断检测按键标志,按键标志由按键外部中断来更改 if(Flag_Tim0) //8253计数定时结束时,读取探头的计数,刚开始Flag_Tim0=0,仅当Flag8253Counting计数定时标识为1,且计数器中断次数大于设定的中断次数时,Flag_timo才会等于1 { //Flag_Tim0为计数器结束标志,初始为0,开机打开定时器中断后,定时器5ms中断一次,检查Flag_Tim0一次,为一表示计数器计时结束 Flag_Tim0 = 0; //定时标志清0 Flag_Warn = 0; //报警标志清0 GetAndDisdata(); //从8253的锁存器得到测量计数器结果,存入至buf数组 ShowData(); //显示测量数据 shortdelay(1000); // Transfer(); //并行传输数据 // bakeup_conv_data(); Init_8253(); //初始化8253 //定时结束时,立刻又开始初始化进行计数 } if(Flag_Tim0 == 0) //开启8253计数过程中,处理报警中断,报警有中断吗? { if(Flag_Warn_Flash == 1) //主机LED指示灯闪烁间隔定时,Flag_Warn_Flash为LED灯闪烁标志 { Flag_Warn_Flash = 0; Led_Flash(); } if((Flag_Warn_Led==1) && (PCOLSIG==0)) //屏幕上红灯闪烁间隔定时,程序中没有找到PCOLSIG=0的程序段 { Flag_Warn_Led = 0; RedLed_Flash(); //灯闪烁 } } } }
void UltraSonic_Init(void) { Init_MCU(); Init_Parameter(); }
void My_Init(void) { Init_MCU(); Init_FPU(); }