mirror of https://github.com/rusefi/bldc.git
Merge pull request #232 from wunderk1nd-e/comm-get-values-unity-ctrl-id-fix
[COMM_GET_VALUES] Unity should return second motor controller ID if that is the selected thread
This commit is contained in:
commit
b1117ab3e3
|
@ -353,7 +353,13 @@ void commands_process_packet(unsigned char *data, unsigned int len,
|
||||||
buffer_append_float32(send_buffer, mc_interface_get_pid_pos_now(), 1e6, &ind);
|
buffer_append_float32(send_buffer, mc_interface_get_pid_pos_now(), 1e6, &ind);
|
||||||
}
|
}
|
||||||
if (mask & ((uint32_t)1 << 17)) {
|
if (mask & ((uint32_t)1 << 17)) {
|
||||||
send_buffer[ind++] = app_get_configuration()->controller_id;
|
uint8_t current_controller_id = app_get_configuration()->controller_id;
|
||||||
|
#ifdef HW_HAS_DUAL_MOTORS
|
||||||
|
if (mc_interface_get_motor_thread() == 2) {
|
||||||
|
current_controller_id = utils_second_motor_id();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
send_buffer[ind++] = current_controller_id;
|
||||||
}
|
}
|
||||||
if (mask & ((uint32_t)1 << 18)) {
|
if (mask & ((uint32_t)1 << 18)) {
|
||||||
buffer_append_float16(send_buffer, NTC_TEMP_MOS1(), 1e1, &ind);
|
buffer_append_float16(send_buffer, NTC_TEMP_MOS1(), 1e1, &ind);
|
||||||
|
|
Loading…
Reference in New Issue