mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Ensure dump uses correct command names.
Use shorter command names (mmix and smix) instead of longer ones (motormix) and (mmix). Decrease verbosity of dump command by only outputting commands to reverse servos for servos that are reversed.
This commit is contained in:
parent
68dd60b0e7
commit
08afcaf536
2 changed files with 12 additions and 7 deletions
|
@ -177,6 +177,7 @@ void mixerLoadMix(int index, motorMixer_t *customMixers);
|
||||||
#ifdef USE_SERVOS
|
#ifdef USE_SERVOS
|
||||||
void servoMixerLoadMix(int index, servoMixer_t *customServoMixers);
|
void servoMixerLoadMix(int index, servoMixer_t *customServoMixers);
|
||||||
void loadCustomServoMixer(void);
|
void loadCustomServoMixer(void);
|
||||||
|
int servoDirection(int servoIndex, int fromChannel);
|
||||||
#endif
|
#endif
|
||||||
void mixerResetMotors(void);
|
void mixerResetMotors(void);
|
||||||
void mixTable(void);
|
void mixTable(void);
|
||||||
|
|
|
@ -243,9 +243,9 @@ const clicmd_t cmdTable[] = {
|
||||||
"list\r\n"
|
"list\r\n"
|
||||||
"\t<name>", cliMixer),
|
"\t<name>", cliMixer),
|
||||||
#endif
|
#endif
|
||||||
|
CLI_COMMAND_DEF("mmix", "custom motor mixer", NULL, cliMotorMix),
|
||||||
CLI_COMMAND_DEF("motor", "get/set motor",
|
CLI_COMMAND_DEF("motor", "get/set motor",
|
||||||
"<index> [<value>]", cliMotor),
|
"<index> [<value>]", cliMotor),
|
||||||
CLI_COMMAND_DEF("motormix", "custom motor mixer", NULL, cliMotorMix),
|
|
||||||
CLI_COMMAND_DEF("play_sound", NULL,
|
CLI_COMMAND_DEF("play_sound", NULL,
|
||||||
"[<index>]\r\n", cliPlaySound),
|
"[<index>]\r\n", cliPlaySound),
|
||||||
CLI_COMMAND_DEF("profile", "change profile",
|
CLI_COMMAND_DEF("profile", "change profile",
|
||||||
|
@ -256,14 +256,16 @@ const clicmd_t cmdTable[] = {
|
||||||
CLI_COMMAND_DEF("serial", "configure serial ports", NULL, cliSerial),
|
CLI_COMMAND_DEF("serial", "configure serial ports", NULL, cliSerial),
|
||||||
#ifdef USE_SERVOS
|
#ifdef USE_SERVOS
|
||||||
CLI_COMMAND_DEF("servo", "configure servos", NULL, cliServo),
|
CLI_COMMAND_DEF("servo", "configure servos", NULL, cliServo),
|
||||||
CLI_COMMAND_DEF("servomix", "servo mixer",
|
#endif
|
||||||
|
CLI_COMMAND_DEF("set", "change setting",
|
||||||
|
"[<name>=<value>]", cliSet),
|
||||||
|
#ifdef USE_SERVOS
|
||||||
|
CLI_COMMAND_DEF("smix", "servo mixer",
|
||||||
"<rule> <servo> <source> <rate> <speed> <min> <max> <box>\r\n"
|
"<rule> <servo> <source> <rate> <speed> <min> <max> <box>\r\n"
|
||||||
"\treset\r\n"
|
"\treset\r\n"
|
||||||
"\tload <mixer>\r\n"
|
"\tload <mixer>\r\n"
|
||||||
"\treverse <servo> <source> -1|1", cliServoMix),
|
"\treverse <servo> <source> -1|1", cliServoMix),
|
||||||
#endif
|
#endif
|
||||||
CLI_COMMAND_DEF("set", "change setting",
|
|
||||||
"[<name>=<value>]", cliSet),
|
|
||||||
CLI_COMMAND_DEF("status", "show status", NULL, cliStatus),
|
CLI_COMMAND_DEF("status", "show status", NULL, cliStatus),
|
||||||
CLI_COMMAND_DEF("version", "show version", NULL, cliVersion),
|
CLI_COMMAND_DEF("version", "show version", NULL, cliVersion),
|
||||||
};
|
};
|
||||||
|
@ -1256,7 +1258,7 @@ static void cliDump(char *cmdline)
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
#ifndef USE_QUAD_MIXER_ONLY
|
||||||
printf("mixer %s\r\n", mixerNames[masterConfig.mixerMode - 1]);
|
printf("mixer %s\r\n", mixerNames[masterConfig.mixerMode - 1]);
|
||||||
|
|
||||||
printf("cmix reset\r\n");
|
printf("mmix reset\r\n");
|
||||||
|
|
||||||
for (i = 0; i < MAX_SUPPORTED_MOTORS; i++) {
|
for (i = 0; i < MAX_SUPPORTED_MOTORS; i++) {
|
||||||
if (masterConfig.customMotorMixer[i].throttle == 0.0f)
|
if (masterConfig.customMotorMixer[i].throttle == 0.0f)
|
||||||
|
@ -1265,7 +1267,7 @@ static void cliDump(char *cmdline)
|
||||||
roll = masterConfig.customMotorMixer[i].roll;
|
roll = masterConfig.customMotorMixer[i].roll;
|
||||||
pitch = masterConfig.customMotorMixer[i].pitch;
|
pitch = masterConfig.customMotorMixer[i].pitch;
|
||||||
yaw = masterConfig.customMotorMixer[i].yaw;
|
yaw = masterConfig.customMotorMixer[i].yaw;
|
||||||
printf("cmix %d", i + 1);
|
printf("mmix %d", i + 1);
|
||||||
if (thr < 0)
|
if (thr < 0)
|
||||||
cliWrite(' ');
|
cliWrite(' ');
|
||||||
printf("%s", ftoa(thr, buf));
|
printf("%s", ftoa(thr, buf));
|
||||||
|
@ -1303,7 +1305,9 @@ static void cliDump(char *cmdline)
|
||||||
// print servo directions
|
// print servo directions
|
||||||
for (i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
|
for (i = 0; i < MAX_SUPPORTED_SERVOS; i++) {
|
||||||
for (channel = 0; channel < INPUT_SOURCE_COUNT; channel++) {
|
for (channel = 0; channel < INPUT_SOURCE_COUNT; channel++) {
|
||||||
printf("smix direction %d %d -1\r\n", i + 1 , channel + 1);
|
if (servoDirection(i, channel) < 0) {
|
||||||
|
printf("smix reverse %d %d -1\r\n", i + 1 , channel + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue