add:增加上位机交互框架、Flash R/W 框架

This commit is contained in:
2026-05-08 18:17:26 +08:00
parent f858a672a4
commit 8a5a32b139
21 changed files with 1131 additions and 381 deletions

View File

@@ -24,13 +24,12 @@
*/
uint8_t SETP = 0;
void YkcTask_Function(void const *argument)
{
init_chargers(); /* 初始化桩结构体*/
ulTaskNotifyTake(pdTRUE, portMAX_DELAY); /* 等待桩通讯协议层完成*/
osDelay(5000);
// send_server_address_to_air724();
// send_server_address_to_air724();
while (1)
{
TaskRunTimeStat.YkcTask.threads_runtime = GetTask_RunTime(YkcTaskID);
@@ -39,52 +38,56 @@ void YkcTask_Function(void const *argument)
switch (SETP)
{
case 0:
{
if (g_charger_manager.charger_piles[1 - 1].is_udp_online)
{
uint8_t open_cmd[] = { 0x55, 0xAA, 0x3, 0x01, 0x01, 0xAA, 0x55};
Air724_Message_Send(open_cmd, sizeof(open_cmd));
osDelay(3000);
SETP = 1;
}
else
{
printf("网关:等待桩上电指令\r\n");
osDelay(1000);
SETP = 0;
}
case 0:
{
// 等待桩上电
if (!g_charger_manager.charger_piles[1 - 1].is_udp_online)
{
uint8_t open_cmd[] = {0x55, 0xAA, 0x3, 0x01, 0x01, 0xAA, 0x55};
Air724_Message_Send(open_cmd, sizeof(open_cmd));
osDelay(3000);
SETP = 1;
}
break;
else
{
printf("网关:等待桩上电指令\r\n");
osDelay(1000);
SETP = 0;
}
}
break;
// 云快充登录认证
case 1:
{
if (!g_charger_manager.charger_piles[1 - 1].is_online)
{
charger_to_server_0X01(1);
}
else
{
SETP = 2;
charger_to_server_0X05(1,1);
}
osDelay(5000);
osDelay(5000);
}
break;
// 云快充计费模型请求
case 2:
{
if (!g_charger_manager.charger_piles[1 - 1].get_model)
charger_to_server_0X09(1); // 桩1计费模型请求
else
SETP = 3;
osDelay(3000);
}
break;
case 3:
{
charger_to_server_0X13(1, 1); // 上传状态
local_on_cmd_send_start_charging(1,1);
// local_on_cmd_send_start_charging(1, 1);
osDelay(3000);
}
break;
@@ -92,7 +95,7 @@ void YkcTask_Function(void const *argument)
break;
}
//osDelay(2000);
// osDelay(2000);
}
}