Added define for turning on and off resource management and sensors
This commit is contained in:
parent
1e75f90c52
commit
820e36f227
|
@ -192,7 +192,7 @@ static const char * const lookupTableMagHardware[] = {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (FLASH_SIZE > 64) && !defined(CLI_MINIMAL_VERBOSITY)
|
#if defined(USE_SENSOR_NAMES)
|
||||||
// sync this with sensors_e
|
// sync this with sensors_e
|
||||||
static const char * const sensorTypeNames[] = {
|
static const char * const sensorTypeNames[] = {
|
||||||
"GYRO", "ACC", "BARO", "MAG", "SONAR", "GPS", "GPS+MAG", NULL
|
"GYRO", "ACC", "BARO", "MAG", "SONAR", "GPS", "GPS+MAG", NULL
|
||||||
|
@ -206,7 +206,7 @@ static const char * const sensorHardwareNames[4][15] = {
|
||||||
{ "", "None", "BMP085", "MS5611", "BMP280", NULL },
|
{ "", "None", "BMP085", "MS5611", "BMP280", NULL },
|
||||||
{ "", "None", "HMC5883", "AK8975", "AK8963", NULL }
|
{ "", "None", "HMC5883", "AK8975", "AK8963", NULL }
|
||||||
};
|
};
|
||||||
#endif
|
#endif /* USE_SENSOR_NAMES */
|
||||||
|
|
||||||
static const char * const lookupTableOffOn[] = {
|
static const char * const lookupTableOffOn[] = {
|
||||||
"OFF", "ON"
|
"OFF", "ON"
|
||||||
|
@ -3186,7 +3186,7 @@ static void cliStatus(char *cmdline)
|
||||||
|
|
||||||
cliPrintf("CPU Clock=%dMHz", (SystemCoreClock / 1000000));
|
cliPrintf("CPU Clock=%dMHz", (SystemCoreClock / 1000000));
|
||||||
|
|
||||||
#if (FLASH_SIZE > 64) && !defined(CLI_MINIMAL_VERBOSITY)
|
#if defined(USE_SENSOR_NAMES)
|
||||||
const uint32_t detectedSensorsMask = sensorsMask();
|
const uint32_t detectedSensorsMask = sensorsMask();
|
||||||
for (uint32_t i = 0; ; i++) {
|
for (uint32_t i = 0; ; i++) {
|
||||||
if (sensorTypeNames[i] == NULL) {
|
if (sensorTypeNames[i] == NULL) {
|
||||||
|
@ -3202,7 +3202,7 @@ static void cliStatus(char *cmdline)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* USE_SENSOR_NAMES */
|
||||||
cliPrint("\r\n");
|
cliPrint("\r\n");
|
||||||
|
|
||||||
#ifdef USE_SDCARD
|
#ifdef USE_SDCARD
|
||||||
|
@ -3304,7 +3304,7 @@ static void cliVersion(char *cmdline)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (FLASH_SIZE > 64)
|
#if defined(USE_RESOURCE_MGMT)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const uint8_t owner;
|
const uint8_t owner;
|
||||||
|
@ -3530,7 +3530,7 @@ static void cliResource(char *cmdline)
|
||||||
|
|
||||||
cliShowParseError();
|
cliShowParseError();
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* USE_RESOURCE_MGMT */
|
||||||
|
|
||||||
static void printConfig(char *cmdline, bool doDiff)
|
static void printConfig(char *cmdline, bool doDiff)
|
||||||
{
|
{
|
||||||
|
@ -3572,8 +3572,10 @@ static void printConfig(char *cmdline, bool doDiff)
|
||||||
#endif
|
#endif
|
||||||
printName(dumpMask);
|
printName(dumpMask);
|
||||||
|
|
||||||
|
#ifdef USE_RESOURCE_MGMT
|
||||||
cliPrintHashLine("resources");
|
cliPrintHashLine("resources");
|
||||||
printResource(dumpMask, &defaultConfig);
|
printResource(dumpMask, &defaultConfig);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
#ifndef USE_QUAD_MIXER_ONLY
|
||||||
cliPrintHashLine("mixer");
|
cliPrintHashLine("mixer");
|
||||||
|
@ -3758,28 +3760,23 @@ const clicmd_t cmdTable[] = {
|
||||||
#ifdef LED_STRIP
|
#ifdef LED_STRIP
|
||||||
CLI_COMMAND_DEF("led", "configure leds", NULL, cliLed),
|
CLI_COMMAND_DEF("led", "configure leds", NULL, cliLed),
|
||||||
#endif
|
#endif
|
||||||
CLI_COMMAND_DEF("map", "configure rc channel order",
|
CLI_COMMAND_DEF("map", "configure rc channel order", "[<map>]", cliMap),
|
||||||
"[<map>]", cliMap),
|
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
#ifndef USE_QUAD_MIXER_ONLY
|
||||||
CLI_COMMAND_DEF("mixer", "configure mixer", "list\r\n"
|
CLI_COMMAND_DEF("mixer", "configure mixer", "list\r\n\t<name>", cliMixer),
|
||||||
"\t<name>", cliMixer),
|
|
||||||
#endif
|
#endif
|
||||||
CLI_COMMAND_DEF("mmix", "custom motor mixer", NULL, cliMotorMix),
|
CLI_COMMAND_DEF("mmix", "custom motor mixer", NULL, cliMotorMix),
|
||||||
#ifdef LED_STRIP
|
#ifdef LED_STRIP
|
||||||
CLI_COMMAND_DEF("mode_color", "configure mode and special colors", NULL, cliModeColor),
|
CLI_COMMAND_DEF("mode_color", "configure mode and special colors", NULL, cliModeColor),
|
||||||
#endif
|
#endif
|
||||||
CLI_COMMAND_DEF("motor", "get/set motor",
|
CLI_COMMAND_DEF("motor", "get/set motor", "<index> [<value>]", cliMotor),
|
||||||
"<index> [<value>]", cliMotor),
|
|
||||||
CLI_COMMAND_DEF("name", "name of craft", NULL, cliName),
|
CLI_COMMAND_DEF("name", "name of craft", NULL, cliName),
|
||||||
#if (FLASH_SIZE > 128)
|
#if (FLASH_SIZE > 128)
|
||||||
CLI_COMMAND_DEF("play_sound", NULL,
|
CLI_COMMAND_DEF("play_sound", NULL, "[<index>]", cliPlaySound),
|
||||||
"[<index>]", cliPlaySound),
|
|
||||||
#endif
|
#endif
|
||||||
CLI_COMMAND_DEF("profile", "change profile",
|
CLI_COMMAND_DEF("profile", "change profile", "[<index>]", cliProfile),
|
||||||
"[<index>]", cliProfile),
|
|
||||||
CLI_COMMAND_DEF("rateprofile", "change rate profile", "[<index>]", cliRateProfile),
|
CLI_COMMAND_DEF("rateprofile", "change rate profile", "[<index>]", cliRateProfile),
|
||||||
#if (FLASH_SIZE > 64)
|
#if defined(USE_RESOURCE_MGMT)
|
||||||
CLI_COMMAND_DEF("resource", "view currently used resources", NULL, cliResource),
|
CLI_COMMAND_DEF("resource", "show/set resources", NULL, cliResource),
|
||||||
#endif
|
#endif
|
||||||
CLI_COMMAND_DEF("rxfail", "show/set rx failsafe settings", NULL, cliRxFail),
|
CLI_COMMAND_DEF("rxfail", "show/set rx failsafe settings", NULL, cliRxFail),
|
||||||
CLI_COMMAND_DEF("rxrange", "configure rx channel ranges", NULL, cliRxRange),
|
CLI_COMMAND_DEF("rxrange", "configure rx channel ranges", NULL, cliRxRange),
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
|
|
||||||
#define SERIAL_RX
|
#define SERIAL_RX
|
||||||
#define USE_SERIALRX_CRSF // Team Black Sheep Crossfire protocol
|
#define USE_SERIALRX_CRSF // Team Black Sheep Crossfire protocol
|
||||||
#define USE_SERIALRX_SPEKTRUM // DSM2 and DSMX protocol
|
#define USE_SERIALRX_SPEKTRUM // SRXL, DSM2 and DSMX protocol
|
||||||
#define USE_SERIALRX_SBUS // Frsky and Futaba receivers
|
#define USE_SERIALRX_SBUS // Frsky and Futaba receivers
|
||||||
#define USE_SERIALRX_IBUS // FlySky and Turnigy receivers
|
#define USE_SERIALRX_IBUS // FlySky and Turnigy receivers
|
||||||
#define USE_SERIALRX_SUMD // Graupner Hott protocol
|
#define USE_SERIALRX_SUMD // Graupner Hott protocol
|
||||||
|
@ -89,6 +89,7 @@
|
||||||
#define TELEMETRY_LTM
|
#define TELEMETRY_LTM
|
||||||
#define TELEMETRY_SMARTPORT
|
#define TELEMETRY_SMARTPORT
|
||||||
#define USE_SERVOS
|
#define USE_SERVOS
|
||||||
|
#define USE_RESOURCE_MGMT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (FLASH_SIZE > 128)
|
#if (FLASH_SIZE > 128)
|
||||||
|
@ -104,6 +105,7 @@
|
||||||
#define USE_SERIALRX_JETIEXBUS
|
#define USE_SERIALRX_JETIEXBUS
|
||||||
#define VTX_CONTROL
|
#define VTX_CONTROL
|
||||||
#define VTX_SMARTAUDIO
|
#define VTX_SMARTAUDIO
|
||||||
|
#define USE_SENSOR_NAMES
|
||||||
#else
|
#else
|
||||||
#define SKIP_CLI_COMMAND_HELP
|
#define SKIP_CLI_COMMAND_HELP
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue