fix(flash): 修改角度存储类型为float并更新读写逻辑
将FlashEEPROM中角度数据的存储类型从u16改为float,并相应地更新了读写函数。 新增readFloat和writeFloat函数以支持浮点数存储,同时调整了虚拟地址类型为u8。 修改了save_angle和read_angle函数实现,确保角度值能正确保存与读取。 优化了格式化函数中的数据解析方式,提高数据存储可靠性。
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user