mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-10-06 09:02:52 +08:00
fix(dshot): set telemetry bit on DShot commands
Bluejay and BLHeli_S ignore commands unless the tlm bit is set, so EDT enable never latched. ESC_INFO keeps it clear: AM32 answers the bit with a KISS frame on the same UART as the EEPROM dump and aborts that frame when the dump starts, so the response would begin with a truncated frame. Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
This commit is contained in:
@@ -398,7 +398,11 @@ void DShot::update_motor_commands(int num_outputs)
|
||||
command_sent = true;
|
||||
}
|
||||
|
||||
up_dshot_motor_command(i, command, false);
|
||||
// Bluejay/BLHeli_S discard commands unless the tlm bit is set. It stays clear on commands answered
|
||||
// over the telemetry UART: AM32 reads it as a KISS request and starts that frame on the same wire,
|
||||
// then aborts it a few loop iterations later to send the EEPROM dump.
|
||||
const bool request_telemetry = command != DSHOT_CMD_MOTOR_STOP && !_current_command.expect_response;
|
||||
up_dshot_motor_command(i, command, request_telemetry);
|
||||
}
|
||||
|
||||
if (command_sent) {
|
||||
|
||||
@@ -278,6 +278,8 @@ TelemetryStatus DShotTelemetry::decodeTelemetryResponse(uint8_t *buffer, int len
|
||||
|
||||
void DShotTelemetry::setExpectCommandResponse(int motor_index, uint16_t command)
|
||||
{
|
||||
// Earlier commands sent with the tlm bit set leave KISS frames in the RX FIFO.
|
||||
_uart.flush();
|
||||
_command_response_motor_index = motor_index;
|
||||
_command_response_command = command;
|
||||
_command_response_start = hrt_absolute_time();
|
||||
|
||||
Reference in New Issue
Block a user