feat: 心跳包新增固件版本号字段,更新协议文档
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user