Files

52 lines
1.7 KiB
C
Raw Permalink 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 "application.h"
#include "iwdg.h"
#include "jb_port.h"
#include "jb_protocol.h"
/*******************状态机应用层开始********************/
void app_machine_handle(void)
{
}
/***************状态机应用层结束************************/
void version_printf(void)
{
appPrintf(LOG_NOTIC, "Developer:%s\r\n", __DEVELOPER__);
appPrintf(LOG_NOTIC, "Email:%s\r\n", __EMAIL__);
appPrintf(LOG_NOTIC, "Project:%s\r\n", __PROJECT_CODE__);
appPrintf(LOG_NOTIC, "SW Version:%u.%u.%u\r\n",
(unsigned)JB_MCU_SW_VERSION_MAJOR,
(unsigned)JB_MCU_SW_VERSION_MINOR,
(unsigned)JB_MCU_SW_VERSION_PATCH);
appPrintf(LOG_NOTIC, "HW Version:%u.%u.%u\r\n",
(unsigned)JB_MCU_HW_VERSION_MAJOR,
(unsigned)JB_MCU_HW_VERSION_MINOR,
(unsigned)JB_MCU_HW_VERSION_PATCH);
appPrintf(LOG_NOTIC, "Compiler Date:%s\r\n", __DATE__);
appPrintf(LOG_NOTIC, "Compiler Time:%s\r\n", __TIME__);
}
void app_Init(void)
{
// 系统初始化
DEBUG_USART_Config(); /* 将串口配置成日志口 */
version_printf(); /* 打印版本信息 */
timerInit(); /* TIM6 1ms 节拍,供协议超时/重传 */
jbInit(); /* 协议初始化 */
userInit(); /* 用户初始化 */
uartInit(); /* USART3 PB10/PB119600 8N1 */
}
void app_lication(void)
{
while (1)
{
app_machine_handle(); /* 状态机处理函数 */
jb_port_uart_run(); /* 串口调试日志 */
userHandle(); /* 用户处理函数 */
jbProtocolHandle(&gDevData); /* 协议处理函数 */
iwdg_feed(); /* 看门狗喂狗 */
}
}