feat: 心跳包新增固件版本号字段,更新协议文档

This commit is contained in:
edisondeng
2026-05-10 11:24:49 +08:00
parent aed62f7bb4
commit 7171f11534
5 changed files with 83 additions and 28 deletions

View File

@ -48,6 +48,32 @@ extern "C" {
/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
// 基准年份
#define XTELL_BASE_YEAR 2026
/**
* 宏定义3-4-5-4 固件版本编码
* y: Year (2026-2033)
* m: Month (1-12)
* d: Day (1-31)
* b: Build (0-15)
*/
#define MAKE_XTELL_CODE(y, m, d, b) ( \
((( (y) - XTELL_BASE_YEAR ) & 0x07) << 13) | \
(((m) & 0x0F) << 9) | \
(((d) & 0x1F) << 4) | \
(((b) & 0x0F) << 0) \
)
// 举例2026年3月19日第10次编译 (b=9)
// 计算过程: (0 << 13) | (3 << 9) | (19 << 4) | 9 = 0x0600 | 0x0130 | 0x0009
#define XTELL_FIRMWARE_CODE MAKE_XTELL_CODE(2026, 5, 10, 1)
// ---- - -- -
// | | | |
// | | | 编译次数
// | | 日
// | 月
// 年
#ifndef USE_W5500
#define USE_W5500 1 /* 默认启用W5500以太网模块 */
#endif

View File

@ -14,7 +14,7 @@
/* Modbus TCP 配置 */
#if TEST_A701
#define MODBUS_SERVER_IP {192, 168, 6, 4} /* A701 测试服务器 */
#define MODBUS_SERVER_IP {192, 168, 0, 6} /* A701 测试服务器 */
#else
#define MODBUS_SERVER_IP {192, 168, 0, 1} /* 现场生产服务器 */
#endif