From d932c98dc89a89e683b38e7150d9bd4d2a0b59bb Mon Sep 17 00:00:00 2001 From: wrh Date: Fri, 9 Oct 2026 09:22:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E8=87=B3V1.1.54=E5=B9=B6=E4=BC=98=E5=8C=96=E5=8D=97=E5=90=91?= =?UTF-8?q?=E5=86=99=E5=AF=84=E5=AD=98=E5=99=A8=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 更新协议板版本寄存器值为0x0146 2 调整短路测试启动间隔为100ms 3 修改电压源选择默认值为6 4 移除南向写寄存器调试打印宏 5 新增基于实际通道号的南向写寄存器调试日志 6 同步版本号与日志文档内容 --- apps/chrg/applications/thread/chrg_comm.c | 2 +- apps/chrg/applications/thread/chrg_north.h | 2 +- apps/chrg/applications/thread/chrg_roll_sou.c | 10 ++++++++++ apps/chrg/applications/utils/chrg_def.h | 4 ++-- apps/chrg/applications/utils/chrg_eload.c | 4 ---- apps/chrg/applications/utils/chrg_sink.h | 2 +- docs/修改日志.md | 7 +++++++ 7 files changed, 22 insertions(+), 9 deletions(-) diff --git a/apps/chrg/applications/thread/chrg_comm.c b/apps/chrg/applications/thread/chrg_comm.c index dd2031b..2466bd1 100644 --- a/apps/chrg/applications/thread/chrg_comm.c +++ b/apps/chrg/applications/thread/chrg_comm.c @@ -27,7 +27,7 @@ #include "stm32f4xx_hal.h" #define HOLD_REG_FIRMWARE_VERSION 0x0300U /* 协议板固件版本,只读 */ -#define CHRG_FIRMWARE_VERSION 0x0145U /* 当前协议板版本:V1.1.53 */ +#define CHRG_FIRMWARE_VERSION 0x0146U /* 当前协议板版本:V1.1.54 */ rt_uint8_t ucDiscInBuf[(TOTAL_DISC_REGS+BITS_UCHAR-1)/BITS_UCHAR]; diff --git a/apps/chrg/applications/thread/chrg_north.h b/apps/chrg/applications/thread/chrg_north.h index 1b1a722..fb2b234 100644 --- a/apps/chrg/applications/thread/chrg_north.h +++ b/apps/chrg/applications/thread/chrg_north.h @@ -16,7 +16,7 @@ #include "chrg_def.h" /* V_On启停判定电压源:切换后需重新编译固件。 */ -#define SINK_VON_VOLTAGE_FROM_PROTOCOL 1U +#define SINK_VON_VOLTAGE_FROM_PROTOCOL 6U #define SINK_VON_VOLTAGE_FROM_POWER 2U #ifndef SINK_VON_VOLTAGE_SOURCE #define SINK_VON_VOLTAGE_SOURCE SINK_VON_VOLTAGE_FROM_POWER diff --git a/apps/chrg/applications/thread/chrg_roll_sou.c b/apps/chrg/applications/thread/chrg_roll_sou.c index e0b00a8..afb19a1 100644 --- a/apps/chrg/applications/thread/chrg_roll_sou.c +++ b/apps/chrg/applications/thread/chrg_roll_sou.c @@ -963,6 +963,11 @@ void chrg_roll_sou_thread_entry (void *data) continue; } pROLL->idx = (eIDX_SOU_CH)single_ch; + #if SOUTH_COMMAND_DEBUG + /* 此处已完成物理通道选通,打印通道号比固定的Modbus从机地址更便于排查。 */ + rt_kprintf("south write: ch=%d reg=0x%04x value=0x%04x\n", + single_ch + 1U, single_reg, single_value); + #endif chrg_eload_write_reg(ID_ELOAD, single_reg, single_value); } break; @@ -983,6 +988,11 @@ void chrg_roll_sou_thread_entry (void *data) continue; } pROLL->idx = (eIDX_SOU_CH)command_ch; + #if SOUTH_COMMAND_DEBUG + /* COM批次按选通后的实际通道打印南向写寄存器指令。 */ + rt_kprintf("south write: ch=%d reg=0x%04x value=0x%04x\n", + command_ch + 1U, command_reg, command_value); + #endif chrg_eload_write_reg(ID_ELOAD, command_reg, command_value); } break; diff --git a/apps/chrg/applications/utils/chrg_def.h b/apps/chrg/applications/utils/chrg_def.h index f2bb32c..9b6513c 100644 --- a/apps/chrg/applications/utils/chrg_def.h +++ b/apps/chrg/applications/utils/chrg_def.h @@ -14,8 +14,8 @@ /* CHRG application version. Keep this value synchronized with the changelog. */ #define CHRG_VERSION_MAJOR 1U #define CHRG_VERSION_MINOR 1U -#define CHRG_VERSION_PATCH 53U -#define CHRG_VERSION_STRING "V1.1.53" +#define CHRG_VERSION_PATCH 54U +#define CHRG_VERSION_STRING "V1.1.54" /* * Channel polling mode: diff --git a/apps/chrg/applications/utils/chrg_eload.c b/apps/chrg/applications/utils/chrg_eload.c index 16bec7e..40c849f 100644 --- a/apps/chrg/applications/utils/chrg_eload.c +++ b/apps/chrg/applications/utils/chrg_eload.c @@ -276,10 +276,6 @@ int chrg_eload_read_regs (rt_uint8_t addr, rt_uint16_t reg, rt_uint16_t len) u16_to_u8v(value, &buf[4]); crc = mb_crc16(buf, 6); u16_to_u8v(swap_u16(crc), &buf[6]); -#if SOUTH_COMMAND_DEBUG - rt_kprintf("south write: addr=%d reg=0x%04x value=0x%04x\n", - addr, reg, value); -#endif return chrg_south_send(buf, 8); } diff --git a/apps/chrg/applications/utils/chrg_sink.h b/apps/chrg/applications/utils/chrg_sink.h index b9083e6..9c3d409 100644 --- a/apps/chrg/applications/utils/chrg_sink.h +++ b/apps/chrg/applications/utils/chrg_sink.h @@ -21,7 +21,7 @@ struct chrg_switch_t; #define SINK_TEST_OCP 2 #define SINK_TEST_DYNA 3 /* 短路测试期间按该周期补发WORK_START,防止功率板因超时停止。 */ -#define SINK_SHORT_START_INTERVAL_MS 50U +#define SINK_SHORT_START_INTERVAL_MS 100U /* 短路测试不受普通V_ON门槛限制,功率板使用最低启动电压。 */ #define SINK_SHORT_TEST_VON_MV 500U //短路测试结构体 diff --git a/docs/修改日志.md b/docs/修改日志.md index a90783e..04b218d 100644 --- a/docs/修改日志.md +++ b/docs/修改日志.md @@ -1,5 +1,12 @@ # 修改日志 +## V1.1.54 - 2026-10-05 + +### 南向写寄存器打印通道号 + +- 南向写寄存器日志改为打印实际选通通道号,不再打印固定的Modbus从机地址。 +- 协议板版本寄存器 `0x0300` 更新为 `0x0146`。 + ## V1.1.53 - 2026-09-30 ### 负载协议切换后CC恢复