1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 19:40:31 +03:00

Fix blocking DSHOT commands

Motor and DSHOT refactoring broke blocking DSHOT commands as the check for commands being enabled was not taking into account that "blocking" type commands need to operate only when the motors are not enabled.

Fixes the CLI `dshotprog` command.
This commit is contained in:
Bruce Luckcuck 2020-04-17 08:29:24 -04:00
parent a2aa3f19f4
commit c6c9ba7229
5 changed files with 28 additions and 21 deletions

View file

@ -3803,7 +3803,7 @@ static void executeEscInfoCommand(const char *cmdName, uint8_t escIndex)
startEscDataRead(escInfoBuffer, ESC_INFO_BLHELI32_EXPECTED_FRAME_SIZE);
dshotCommandWrite(escIndex, getMotorCount(), DSHOT_CMD_ESC_INFO, true);
dshotCommandWrite(escIndex, getMotorCount(), DSHOT_CMD_ESC_INFO, DSHOT_CMD_TYPE_BLOCKING);
delay(10);
@ -3811,9 +3811,6 @@ static void executeEscInfoCommand(const char *cmdName, uint8_t escIndex)
}
#endif // USE_ESC_SENSOR && USE_ESC_SENSOR_INFO
// XXX Review dshotprog command under refactored motor handling
static void cliDshotProg(const char *cmdName, char *cmdline)
{
if (isEmpty(cmdline) || !isMotorProtocolDshot()) {
@ -3854,7 +3851,7 @@ static void cliDshotProg(const char *cmdName, char *cmdline)
}
if (command != DSHOT_CMD_ESC_INFO) {
dshotCommandWrite(escIndex, getMotorCount(), command, true);
dshotCommandWrite(escIndex, getMotorCount(), command, DSHOT_CMD_TYPE_BLOCKING);
} else {
#if defined(USE_ESC_SENSOR) && defined(USE_ESC_SENSOR_INFO)
if (featureIsEnabled(FEATURE_ESC_SENSOR)) {