🐛 fix(optic_mag_driver): 修正光泵磁力计数据单位

- 将数据单位从 0.0001 nT 改为 0.001 nT
- 更新注释中的示例值以匹配新的单位换算
This commit is contained in:
zhoujie 2026-06-08 21:30:32 +08:00
parent bc37e14fba
commit 047ef08318
2 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ typedef struct __attribute__((packed)) {
float gps_longitude;
float gps_altitude;
#endif
uint32_t optical_mag; // 单位 0.0001 nT例如 123456789 = 12345.6789 nT
uint32_t optical_mag; // 单位 0.001 nT例如 123456789 = 123456.789 nT
} DataPacketWithOptic_t;
// ─── 校正数据包 ───────────────────────────────────────────────────────────────
@ -75,7 +75,7 @@ typedef struct __attribute__((packed)) {
float gps_longitude;
float gps_altitude;
#endif
uint32_t optical_mag; // 单位 0.0001 nT
uint32_t optical_mag; // 单位 0.001 nT
} CorrectedDataPacketWithOptic_t;
// ─── 函数声明 ─────────────────────────────────────────────────────────────────

View File

@ -8,8 +8,8 @@
#define OPTIC_MAG_FRAME_END 0xA5
#define OPTIC_MAG_DATA_BYTES 10
// 单位 0.0001 nT忽略末位BCD数字取前9位
// 例如 123456789 表示 12345.6789 nT
// 单位 0.001 nT忽略末位BCD数字取前9位
// 例如 123456789 表示 123456.789 nT
extern volatile uint32_t g_optic_mag_value;
extern volatile uint8_t g_optic_mag_fresh;