12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #include "global.h"
- unsigned long cStartDelay;
- unsigned long cBootWifiDelay;
- unsigned char BootWifiFlg;
- int main(void)
- {
- hw_board_init();
- //参数变量初始化
- variable_init();
- //读取存储参数
- poweroff_app_init();
- //根据机器类型,配置使用的硬件资源
- GetMachineType();
- Mechine_Config();
-
- //应用初始化
- InitUart();
- mosbus_app_init();
- EncoderInit();
- InitPWM();
- user_app_init();
- nodelink_master_app_init();
- log_app_init();
- InitAction();
- cStartDelay = dwTickCount + 500;
- cBootWifiDelay = dwTickCount + 10000;
-
- //可变输入输出初始化
- IOPinDefualtConf_INOUT();
- IOPinDefualtConf_OUTOUT();
-
- while(dwTickCount <= cStartDelay)
- {
- io_app_read_input();
- io_app_write_ouput();
- }
-
- while (1)
- {
-
- //运行状态
- hw_run_status_show();
- io_app_read_input();
-
- Action();
- poweroff_app_run();
- user_app_run();
- CheckTimeOver();
-
- io_app_write_ouput();
- nodelink_master_app_run();
- ReSetWifi();
- //通讯协议
- modbus_app_proc();
- //上电延时连接wifi
- if(MACHINE_BOOT_WIFI && dwTickCount >= cBootWifiDelay && !BootWifiFlg)
- {
- BootWifiFlg=1;
- M1000 = 1;
- user_datas[1604] = 1;
- }
- }
- }
|