Fixed dual motor CAN regression

This commit is contained in:
Benjamin Vedder 2020-12-02 20:56:00 +01:00
parent e5c5b3e655
commit 242a1924e1
2 changed files with 2 additions and 2 deletions

View File

@ -1297,7 +1297,7 @@ static void decode_msg(uint32_t eid, uint8_t *data8, int len, bool is_replaced)
case CAN_PACKET_PING: {
uint8_t buffer[2];
buffer[0] = app_get_configuration()->controller_id;
buffer[0] = is_replaced ? utils_second_motor_id() : app_get_configuration()->controller_id;
buffer[1] = HW_TYPE_VESC;
comm_can_transmit_eid_replace(data8[0] |
((uint32_t)CAN_PACKET_PONG << 8), buffer, 2, true);

View File

@ -1102,7 +1102,7 @@ void commands_process_packet(unsigned char *data, unsigned int len,
bool is_ext = data[ind++];
if (is_ext) {
comm_can_transmit_eid(id, data + ind, len - ind);
comm_can_transmit_eid_replace(id, data + ind, len - ind, true);
} else {
comm_can_transmit_sid(id, data + ind, len - ind);
}