fix(flash): 修改角度存储类型为float并更新读写逻辑

将FlashEEPROM中角度数据的存储类型从u16改为float,并相应地更新了读写函数。
新增readFloat和writeFloat函数以支持浮点数存储,同时调整了虚拟地址类型为u8。
修改了save_angle和read_angle函数实现,确保角度值能正确保存与读取。
优化了格式化函数中的数据解析方式,提高数据存储可靠性。
This commit is contained in:
cbb
2025-12-17 02:34:08 +08:00
parent 02572df688
commit d6cf143e87
3 changed files with 169 additions and 69 deletions
+1 -1
View File
@@ -696,7 +696,7 @@ void CAN_transmiter::communication_check() {
FOC.target_velocity = target_velocity_union.f;
} else if (receive_message.rx_efid == 0x00010301) {
motor_reset();
flashEEP.save_angle((u16)FOC.rt_angle, false);
flashEEP.save_angle(FOC.rt_angle, false);
} else {
printf("Unknown CAN ID: %X\n", receive_message.rx_efid);
}