![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Original Version of STM Board
Diff: CAN/function_CAN.cpp
- Revision:
- 239:a9507d8a4674
- Parent:
- 236:c16774af92ed
diff -r bbb74caca589 -r a9507d8a4674 CAN/function_CAN.cpp --- a/CAN/function_CAN.cpp Sat Jul 10 04:39:20 2021 +0000 +++ b/CAN/function_CAN.cpp Thu Oct 06 07:18:55 2022 +0000 @@ -506,8 +506,8 @@ } case CRX_SET_TORQUE_SENSOR_PULSE_PER_TORQUE: { - TORQUE_SENSOR_PULSE_PER_TORQUE = (float) ((int16_t) (msg.data[1] | msg.data[2] << 8) * 0.01f); - spi_eeprom_write(RID_TORQUE_SENSOR_PULSE_PER_TORQUE, (int16_t) (TORQUE_SENSOR_PULSE_PER_TORQUE*100.0f)); + TORQUE_SENSOR_PULSE_PER_TORQUE = (float) ((int16_t) (msg.data[1] | msg.data[2] << 8) * 0.001f); + spi_eeprom_write(RID_TORQUE_SENSOR_PULSE_PER_TORQUE, (int16_t) (TORQUE_SENSOR_PULSE_PER_TORQUE*1000.0f)); break; } @@ -1107,7 +1107,7 @@ temp_msg.id = CID_TX_INFO; temp_msg.len = 3; temp_msg.data[0] = (uint8_t) CTX_SEND_TORQUE_SENSOR_PULSE_PER_TORQUE; - int temp_torque_sensor_pulse_per_torque = (int) (TORQUE_SENSOR_PULSE_PER_TORQUE * 100.0f); + int temp_torque_sensor_pulse_per_torque = (int) (TORQUE_SENSOR_PULSE_PER_TORQUE * 1000.0f); temp_msg.data[1] = (uint8_t) temp_torque_sensor_pulse_per_torque; temp_msg.data[2] = (uint8_t) (temp_torque_sensor_pulse_per_torque >> 8);