HAL_Project/Project -APP-V1.0/Core/Src/main.c.orig

40 lines
1.4 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "main.h"
/*---------------------------------------------------------------------------------*/
/* 级联8路继电器控制板HAL库版本 版本V1.0 */
/* */
/*---------------------------------------------------------------------------------*/
//Lora网关测试-01
MqttInfo_Str MqttInfo_Struct= {
"a284c67982b089f9",
"767836280083469392",
"125a0cfa04b8bc3b",
"58.17.14.95",
"/iot/data/down/",
1880
};//创建一个用于连接云mqtt的结构体
int main(void) {
HAL_Init(); // 必要初始化
systemClockConfig(); // 系统时钟初始化 主频72M
usart1Init(921600); // 串口1初始化 波特率921600 用于串口打印 debug调试 printf
usart2Init(9600); // 串口2初始化 波特率9600 DAM传输 用于连接-合宙4G-模块通信
ledGpioInit(); // LED引脚初始化 指示灯
relayGpioInit(); //继电器引脚初始化
catGpioInit(); //4G模块初始化
log_info("********************APP-Code********************");
log_info("服 务 器:%s:%d", MqttInfo_Struct.ServerIP, MqttInfo_Struct.ServerPort); // 串口输出调试信息
log_info("客户端ID%s", MqttInfo_Struct.ClientID); // 串口输出调试信息
log_info("用 户 名:%s", MqttInfo_Struct.Username); // 串口输出调试信息
log_info("密 码:%s", MqttInfo_Struct.Passward); // 串口输出调试信息
catReset();//卡模块联网
while (1) {
usart2RxHandle(); // 4G接收数据处理
usart2TxHandle(); // 4G发送数据处理
activeEvents(); // 主动事件
}
}