fix:更新注释等

This commit is contained in:
2026-05-21 12:19:01 +08:00
parent fd65e9c6a2
commit 8ee0849831
54 changed files with 1145 additions and 683 deletions

View File

@@ -1,11 +1,11 @@
/**
* @file udp_manager.c
* @brief UDP管理模块
* @details 处理充电桩与服务器之间的UDP通信提供数据发送功能。
* 支持向指定充电桩发送数据以及向上位机服务器发送数据。
* @date 2025-01-09 14:32:15
* @version 1.0.0
* @copyright Copyright (c) 2026
******************************************************************************
* @file User\App\task_air724.c
* @author 路淮
* @version v0.1
* @date 2026-05-21
* @brief 4G模块通信任务处理模块
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
@@ -40,10 +40,6 @@ void air724_recv_task_function(void const *argument)
/**/
while (1)
{
/*---------------------------------------------------获取任务运行状态---------------------------------------------------*/
TaskRunTimeStat.DownLinkTask.threads_runtime = GetTask_RunTime(DownLinkTaskID);
TaskRunTimeStat.DownLinkTask.threads_counter = GetTask_Beatcnt(DownLinkTaskID);
TaskRunTimeStat.DownLinkTask.threads_freestack = Get_Free_Stack(DownLinkTaskID);
if (xQueueReceive(Air724_Message_Queue, &air724_rx_msg, 10) == pdPASS)
{
@@ -80,7 +76,7 @@ void air724_recv_task_function(void const *argument)
case 0x86:
case 0x87:
{
drv_air724_parse_response(air724_rx_msg, UART1_RX_BUFFER_SIZE);
drv_air724_parse_response(air724_rx_msg, UART1_RX_BUFFER_SIZE);// 4G模块回传命令数据解析
}
break;
}

View File

@@ -1,8 +1,18 @@
/**
******************************************************************************
* @file User\App\task_air724.h
* @author 路淮
* @version v0.1
* @date 2026-05-21
* @brief 4G模块通信任务头文件
******************************************************************************
*/
#ifndef __AIR724_RECV_TASK_H
#define __AIR724_RECV_TASK_H
/* includes ----------------------------------------------------------------------------------------------*/
/* includes ------------------------------------------------------------------*/
#include "global.h"
/* macro ------------------------------------------------------------------------------------------------*/

View File

@@ -1,10 +1,10 @@
/**
******************************************************************************
* @file user\task\HeartBeatTask.c
* @author luhuaishuai
* @file User\App\task_sys.c
* @author 路淮
* @version v0.1
* @date 2026-1-12
* @brief 心跳任务,负责发送心跳包和处理云快充的响应
* @date 2026-05-21
* @brief 系统任务
******************************************************************************
*/
@@ -13,20 +13,16 @@
void HeartBeat_Sign(void);
/**
* @funNm : HeartbeatTask_Function
* @brief : 心跳
* @param : argument
* @retval: void
* @brief sys_task_function:系统任务
* @note none
* @param none
* @retval none
*/
void sys_task_function(void const *argument)
{
while (1)
{
TaskRunTimeStat.HeartBeatTask.threads_runtime = GetTask_RunTime(HeartBeatTaskID);
TaskRunTimeStat.HeartBeatTask.threads_counter = GetTask_Beatcnt(HeartBeatTaskID);
TaskRunTimeStat.HeartBeatTask.threads_freestack = Get_Free_Stack(HeartBeatTaskID);
HeartBeat_Sign(); // 指示灯、蜂鸣器

View File

@@ -1,7 +1,17 @@
/**
******************************************************************************
* @file User\App\task_sys.h
* @author 路淮
* @version v0.1
* @date 2026-05-21
* @brief 系统任务头文件
******************************************************************************
*/
#ifndef __TASK_SYS_H
#define __TASK_SYS_H
/* includes ----------------------------------------------------------------------------------------------*/
/* includes ------------------------------------------------------------------*/
#include "global.h"
#include "cmsis_os.h" // 或使用 HAL_GetTick() 等

View File

@@ -1,26 +1,21 @@
/**
* @file task_udp.c
* @brief UDP通信任务处理模块
* @details 处理充电桩与服务器之间的UDP通信协议包括UDP数据接收、数据解析和路由分发等功能。
* 支持JSON格式的数据交互通过FreeRTOS任务和队列机制实现异步数据处理。
* 包含两个主要任务UDP数据接收任务(udp_recv_task_function)和UDP数据解析任务(udp_parse_task_function)。
* @date 2025-01-09 14:32:15
* @version 1.0.0
* @copyright Copyright (c) 2026
******************************************************************************
* @file User\App\task_udp.c
* @author 路淮
* @version v0.1
* @date 2026-05-21
* @brief UDP通信任务处理模块
******************************************************************************
*/
#include "task_udp.h"
/**
* @brief udp_recv_taskUDP 数据接受任务
*
* @brief udp_recv_task_functionUDP 数据接受任务
* @note none
*
* @param taskID : 任务ID
*
* @retval runtime : 任务周期
* @param none
* @retval none
*/
void udp_recv_task_function(void const *argument)
{
err_t recv_err;
@@ -35,11 +30,6 @@ void udp_recv_task_function(void const *argument)
while (1)
{
/*获取任务运行状态*/
TaskRunTimeStat.UPLinkTask.threads_runtime = GetTask_RunTime(UPLinkTaskID);
TaskRunTimeStat.UPLinkTask.threads_counter = GetTask_Beatcnt(UPLinkTaskID);
TaskRunTimeStat.UPLinkTask.threads_freestack = Get_Free_Stack(UPLinkTaskID);
recv_err = netconn_recv(datalink_conn, &datalink_buf);
if (recv_err == ERR_OK && datalink_buf != NULL)
@@ -78,13 +68,10 @@ void udp_recv_task_function(void const *argument)
}
/**
* @brief UDP_ParseTask_FunctionUDP 数据解析任务
*
* @brief udp_parse_task_functionUDP 数据解析任务
* @note none
*
* @param taskID : 任务ID
*
* @retval runtime : 任务周期
* @param none
* @retval none
*/
void udp_parse_task_function(void const *argument)
{

View File

@@ -1,8 +1,18 @@
/**
******************************************************************************
* @file User\App\task_udp.h
* @author 路淮
* @version v0.1
* @date 2026-05-21
* @brief UDP通信任务头文件
******************************************************************************
*/
#ifndef __UDP_TASK_H
#define __UDP_TASK_H
/* includes ----------------------------------------------------------------------------------------------*/
/* includes ------------------------------------------------------------------*/
#include "global.h"
#include "board_config.h"
#include "udp_router.h"

View File

@@ -1,10 +1,10 @@
/**
******************************************************************************
* @file user\task\HeartBeatTask.c
* @author luhuaishuai
* @file User\App\task_ykc.c
* @author 路淮
* @version v0.1
* @date 2026-1-12
* @brief Briefly describe the function of your function
* @date 2026-05-21
* @brief 云快充平台交互主任务
******************************************************************************
*/
@@ -19,10 +19,9 @@
/**
* @funNm : ykc_task_function
* @brief : 云快充平台交互主任务
* @param : argument
* @retval: void
* @param : none
* @retval: none
*/
void ykc_task_function(void const *argument)
{
uint32_t now;
@@ -32,9 +31,6 @@ void ykc_task_function(void const *argument)
osDelay(5000);
while (1)
{
TaskRunTimeStat.YkcTask.threads_runtime = GetTask_RunTime(YkcTaskID);
TaskRunTimeStat.YkcTask.threads_counter = GetTask_Beatcnt(YkcTaskID);
TaskRunTimeStat.YkcTask.threads_freestack = Get_Free_Stack(YkcTaskID);
now = HAL_GetTick();
@@ -52,8 +48,7 @@ void ykc_task_function(void const *argument)
{
case 0: // 等待桩上电 + 连接本桩4G通道
{
// if (pile->is_udp_online)
if(1)
if (pile->is_udp_online)
{
if (!g_air724_info.socket_connected[i])
{
@@ -68,8 +63,7 @@ void ykc_task_function(void const *argument)
}
else
{
USB_Printf("网关:等待桩%d上电指令\r\n", i + 1);
drv_air724_query_iccid();
//drv_air724_query_iccid();
pile->step_tick = now + 1000;
}
}
@@ -146,52 +140,12 @@ void ykc_task_function(void const *argument)
}
/**
* @brief 云快充平台状态检查回调
* @note 每 500ms 触发一次,遍历 1-6 号桩检查状态
* @param xTimer 定时器句柄
* @retval none
* @funNm : ykc_timer_callback_function
* @brief : 云快充平台状态检查回调
* @param : xTimer 定时器句柄
* @retval: none
*/
void ykc_timer_callback_function(TimerHandle_t xTimer)
{
for (int i = 0; i < MAX_CHARGER_COUNT; i++)
{
for (int g = 0; g < MAX_GUN_PER_CHARGER; g++)
{
ChargerGun *gun = &g_charger_manager.charger_piles[i].guns[g];
if (gun->charger_state == REDAY_CHARGER_START_STATE)
{
USB_Printf("状态机:[info] 桩%d 枪%d 查询中,等待启动回复.... \r\n", i + 1, g + 1);
}
else if (gun->charger_state == SUCCESS_CHARGER_STATE)
{
USB_Printf("状态机:[success] 桩%d 枪%d 启动成功.... \r\n", i + 1, g + 1);
gun->charger_state = CHARGER_STATE_CHARGING;
}
else if (gun->charger_state == FAIL_CHARGER_STATE)
{
USB_Printf("状态机:[error] 桩%d 枪%d 启动失败.... \r\n", i + 1, g + 1);
}
else if (gun->charger_state == CHARGER_STATE_CHARGING)
{
USB_Printf("状态机:[info] 桩%d 枪%d 充电中.... \r\n", i + 1, g + 1);
}
else if (gun->charger_state == REDAY_CHARGER_STOP_STATE)
{
USB_Printf("状态机:[info] 桩%d 枪%d 查询中,等待停止回复.... \r\n", i + 1, g + 1);
}
else if (gun->charger_state == SUCCESS_CHARGER_STOP_STATE)
{
USB_Printf("状态机:[success] 桩%d 枪%d 停止成功.... \r\n", i + 1, g + 1);
}
else if (gun->charger_state == FAIL_CHARGER_STOP_STATE)
{
USB_Printf("状态机:[error] 桩%d 枪%d 停止失败.... \r\n", i + 1, g + 1);
}
else if (gun->charger_state == CHARGER_STATE_CHARGE_DONE)
{
printf("状态机:[success] 桩%d 枪%d 计费数据已发送,充电完成.... \r\n", i + 1, g + 1);
}
}
}
}

View File

@@ -1,7 +1,17 @@
/**
******************************************************************************
* @file User\App\task_ykc.h
* @author 路淮
* @version v0.1
* @date 2026-05-21
* @brief 云快充平台交互任务头文件
******************************************************************************
*/
#ifndef __TASK_YKC_H
#define __TASK_YKC_H
/* includes ----------------------------------------------------------------------------------------------*/
/* includes ------------------------------------------------------------------*/
#include "global.h"
#include "drv_air724.h"