1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 20:10:18 +03:00

Added USE_ESC_SENSOR_INFO define, cleaned up USE_ESC_SENSOR define. (#5580)

This commit is contained in:
Michael Keller 2018-04-01 11:33:07 +12:00 committed by GitHub
parent b8aa6ac915
commit b5c0076bc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 37 additions and 53 deletions

View file

@ -2372,7 +2372,8 @@ static int parseOutputIndex(char *pch, bool allowAllEscs) {
return outputIndex;
}
#ifdef USE_DSHOT
#if defined(USE_DSHOT)
#if defined(USE_ESC_SENSOR) && defined(USE_ESC_SENSOR_INFO)
#define ESC_INFO_KISS_V1_EXPECTED_FRAME_SIZE 15
#define ESC_INFO_KISS_V2_EXPECTED_FRAME_SIZE 21
@ -2558,6 +2559,7 @@ static void executeEscInfoCommand(uint8_t escIndex)
printEscInfo(escInfoBuffer, getNumberEscBytesRead());
}
#endif // USE_ESC_SENSOR && USE_ESC_SENSOR_INFO
static void cliDshotProg(char *cmdline)
{
@ -2600,12 +2602,19 @@ static void cliDshotProg(char *cmdline)
if (command != DSHOT_CMD_ESC_INFO) {
pwmWriteDshotCommand(escIndex, getMotorCount(), command);
} else {
if (escIndex != ALL_MOTORS) {
executeEscInfoCommand(escIndex);
} else {
for (uint8_t i = 0; i < getMotorCount(); i++) {
executeEscInfoCommand(i);
#if defined(USE_ESC_SENSOR) && defined(USE_ESC_SENSOR_INFO)
if (feature(FEATURE_ESC_SENSOR)) {
if (escIndex != ALL_MOTORS) {
executeEscInfoCommand(escIndex);
} else {
for (uint8_t i = 0; i < getMotorCount(); i++) {
executeEscInfoCommand(i);
}
}
} else
#endif
{
cliPrintLine("Not supported.");
}
}
@ -2628,7 +2637,7 @@ static void cliDshotProg(char *cmdline)
pwmEnableMotors();
}
#endif
#endif // USE_DSHOT
#ifdef USE_ESCSERIAL
static void cliEscPassthrough(char *cmdline)