![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
distribution-201229
Diff: CAN/function_CAN.cpp
- Revision:
- 27:a2254a485f23
- Parent:
- 23:59218d4a256d
- Child:
- 28:2a62d73e3dd0
--- a/CAN/function_CAN.cpp Fri Sep 27 06:57:32 2019 +0000 +++ b/CAN/function_CAN.cpp Tue Oct 01 05:18:16 2019 +0000 @@ -579,6 +579,13 @@ break; } + + case CRX_SET_ROM: { + ROM_RESET_DATA(); + //CONTROL_MODE = 33; + CAN_TX_TORQUE((int16_t) (33)); + break; + } case CRX_JUMP_STATUS: { MODE_JUMP_STATUS = msg.data[1]; @@ -1245,13 +1252,19 @@ can.write(temp_msg); } -void CAN_TX_VALVE_POSITION(int16_t t_valve_pos) { +void CAN_TX_VALVE_POSITION(int16_t t_valve_pos, int16_t t_ref_valve_pos, int16_t t_pwm) +{ CANMessage temp_msg; temp_msg.id = CID_TX_VALVE_POSITION; temp_msg.len = 8; temp_msg.data[0] = (uint8_t) t_valve_pos; temp_msg.data[1] = (uint8_t) (t_valve_pos >> 8); + temp_msg.data[2] = (uint8_t) t_ref_valve_pos; + temp_msg.data[3] = (uint8_t) (t_ref_valve_pos >> 8); + temp_msg.data[4] = (uint8_t) t_pwm; + temp_msg.data[5] = (uint8_t) (t_pwm >> 8); + can.write(temp_msg); }