mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 04:15:44 +03:00
Cleanup disabling of mixers for CJMCU, this might be usefulfor the
AlienWii32 target too. Deleted old out of date comments. Various other minor cleanups.
This commit is contained in:
parent
db14bd80cb
commit
b123b4ef03
6 changed files with 69 additions and 54 deletions
|
@ -74,8 +74,10 @@
|
|||
|
||||
#include "serial_cli.h"
|
||||
|
||||
// we unset this on 'exit'
|
||||
extern uint8_t cliMode;
|
||||
extern uint16_t cycleTime; // FIXME dependency on mw.c
|
||||
|
||||
static serialPort_t *cliPort;
|
||||
|
||||
static void cliAux(char *cmdline);
|
||||
static void cliAdjustmentRange(char *cmdline);
|
||||
static void cliCMix(char *cmdline);
|
||||
|
@ -83,18 +85,6 @@ static void cliDefaults(char *cmdline);
|
|||
static void cliDump(char *cmdLine);
|
||||
static void cliExit(char *cmdline);
|
||||
static void cliFeature(char *cmdline);
|
||||
#ifdef GPS
|
||||
static void cliGpsPassthrough(char *cmdline);
|
||||
#endif
|
||||
static void cliHelp(char *cmdline);
|
||||
static void cliMap(char *cmdline);
|
||||
#ifdef LED_STRIP
|
||||
static void cliLed(char *cmdline);
|
||||
static void cliColor(char *cmdline);
|
||||
#endif
|
||||
#ifndef CJMCU
|
||||
static void cliMixer(char *cmdline);
|
||||
#endif
|
||||
static void cliMotor(char *cmdline);
|
||||
static void cliProfile(char *cmdline);
|
||||
static void cliRateProfile(char *cmdline);
|
||||
|
@ -105,9 +95,21 @@ static void cliGet(char *cmdline);
|
|||
static void cliStatus(char *cmdline);
|
||||
static void cliVersion(char *cmdline);
|
||||
|
||||
extern uint16_t cycleTime; // FIXME dependency on mw.c
|
||||
#ifdef GPS
|
||||
static void cliGpsPassthrough(char *cmdline);
|
||||
#endif
|
||||
|
||||
static serialPort_t *cliPort;
|
||||
static void cliHelp(char *cmdline);
|
||||
static void cliMap(char *cmdline);
|
||||
|
||||
#ifdef LED_STRIP
|
||||
static void cliLed(char *cmdline);
|
||||
static void cliColor(char *cmdline);
|
||||
#endif
|
||||
|
||||
#ifndef USE_QUAD_MIXER_ONLY
|
||||
static void cliMixer(char *cmdline);
|
||||
#endif
|
||||
|
||||
// signal that we're in cli mode
|
||||
uint8_t cliMode = 0;
|
||||
|
@ -116,7 +118,8 @@ uint8_t cliMode = 0;
|
|||
static char cliBuffer[48];
|
||||
static uint32_t bufferIndex = 0;
|
||||
|
||||
// sync this with mutiType_e
|
||||
#ifndef USE_QUAD_MIXER_ONLY
|
||||
// sync this with multiType_e
|
||||
static const char * const mixerNames[] = {
|
||||
"TRI", "QUADP", "QUADX", "BI",
|
||||
"GIMBAL", "Y6", "HEX6",
|
||||
|
@ -125,6 +128,7 @@ static const char * const mixerNames[] = {
|
|||
"HEX6H", "PPM_TO_SERVO", "DUALCOPTER", "SINGLECOPTER",
|
||||
"ATAIL4", "CUSTOM", NULL
|
||||
};
|
||||
#endif
|
||||
|
||||
// sync this with features_e
|
||||
static const char * const featureNames[] = {
|
||||
|
@ -170,7 +174,7 @@ const clicmd_t cmdTable[] = {
|
|||
{ "led", "configure leds", cliLed },
|
||||
#endif
|
||||
{ "map", "mapping of rc channel order", cliMap },
|
||||
#ifndef CJMCU
|
||||
#ifndef USE_QUAD_MIXER_ONLY
|
||||
{ "mixer", "mixer name or list", cliMixer },
|
||||
#endif
|
||||
{ "motor", "get/set motor output value", cliMotor },
|
||||
|
@ -573,7 +577,7 @@ static void cliAdjustmentRange(char *cmdline)
|
|||
|
||||
static void cliCMix(char *cmdline)
|
||||
{
|
||||
#ifdef CJMCU
|
||||
#ifdef USE_QUAD_MIXER_ONLY
|
||||
UNUSED(cmdline);
|
||||
#else
|
||||
int i, check = 0;
|
||||
|
@ -753,9 +757,12 @@ static void cliDump(char *cmdline)
|
|||
{
|
||||
unsigned int i;
|
||||
char buf[16];
|
||||
float thr, roll, pitch, yaw;
|
||||
uint32_t mask;
|
||||
|
||||
#ifndef USE_QUAD_MIXER_ONLY
|
||||
float thr, roll, pitch, yaw;
|
||||
#endif
|
||||
|
||||
uint8_t dumpMask = DUMP_ALL;
|
||||
if (strcasecmp(cmdline, "master") == 0) {
|
||||
dumpMask = DUMP_MASTER; // only
|
||||
|
@ -775,6 +782,7 @@ static void cliDump(char *cmdline)
|
|||
printf("\r\n# dump master\r\n");
|
||||
printf("\r\n# mixer\r\n");
|
||||
|
||||
#ifndef USE_QUAD_MIXER_ONLY
|
||||
printf("mixer %s\r\n", mixerNames[masterConfig.mixerConfiguration - 1]);
|
||||
|
||||
if (masterConfig.customMixer[0].throttle != 0.0f) {
|
||||
|
@ -801,6 +809,7 @@ static void cliDump(char *cmdline)
|
|||
}
|
||||
printf("cmix %d 0 0 0 0\r\n", i + 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
printf("\r\n\r\n# feature\r\n");
|
||||
|
||||
|
@ -1014,7 +1023,7 @@ static void cliMap(char *cmdline)
|
|||
printf("%s\r\n", out);
|
||||
}
|
||||
|
||||
#ifndef CJMCU
|
||||
#ifndef USE_QUAD_MIXER_ONLY
|
||||
static void cliMixer(char *cmdline)
|
||||
{
|
||||
int i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue