Added define for turning on and off resource management and sensors

This commit is contained in:
blckmn 2017-01-10 11:38:16 +11:00
parent 1e75f90c52
commit 820e36f227
2 changed files with 18 additions and 19 deletions

View File

@ -192,7 +192,7 @@ static const char * const lookupTableMagHardware[] = {
};
#endif
#if (FLASH_SIZE > 64) && !defined(CLI_MINIMAL_VERBOSITY)
#if defined(USE_SENSOR_NAMES)
// sync this with sensors_e
static const char * const sensorTypeNames[] = {
"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", "HMC5883", "AK8975", "AK8963", NULL }
};
#endif
#endif /* USE_SENSOR_NAMES */
static const char * const lookupTableOffOn[] = {
"OFF", "ON"
@ -3186,7 +3186,7 @@ static void cliStatus(char *cmdline)
cliPrintf("CPU Clock=%dMHz", (SystemCoreClock / 1000000));
#if (FLASH_SIZE > 64) && !defined(CLI_MINIMAL_VERBOSITY)
#if defined(USE_SENSOR_NAMES)
const uint32_t detectedSensorsMask = sensorsMask();
for (uint32_t i = 0; ; i++) {
if (sensorTypeNames[i] == NULL) {
@ -3202,7 +3202,7 @@ static void cliStatus(char *cmdline)
}
}
}
#endif
#endif /* USE_SENSOR_NAMES */
cliPrint("\r\n");
#ifdef USE_SDCARD
@ -3304,7 +3304,7 @@ static void cliVersion(char *cmdline)
);
}
#if (FLASH_SIZE > 64)
#if defined(USE_RESOURCE_MGMT)
typedef struct {
const uint8_t owner;
@ -3530,7 +3530,7 @@ static void cliResource(char *cmdline)
cliShowParseError();
}
#endif
#endif /* USE_RESOURCE_MGMT */
static void printConfig(char *cmdline, bool doDiff)
{
@ -3572,8 +3572,10 @@ static void printConfig(char *cmdline, bool doDiff)
#endif
printName(dumpMask);
#ifdef USE_RESOURCE_MGMT
cliPrintHashLine("resources");
printResource(dumpMask, &defaultConfig);
#endif
#ifndef USE_QUAD_MIXER_ONLY
cliPrintHashLine("mixer");
@ -3758,28 +3760,23 @@ const clicmd_t cmdTable[] = {
#ifdef LED_STRIP
CLI_COMMAND_DEF("led", "configure leds", NULL, cliLed),
#endif
CLI_COMMAND_DEF("map", "configure rc channel order",
"[<map>]", cliMap),
CLI_COMMAND_DEF("map", "configure rc channel order", "[<map>]", cliMap),
#ifndef USE_QUAD_MIXER_ONLY
CLI_COMMAND_DEF("mixer", "configure mixer", "list\r\n"
"\t<name>", cliMixer),
CLI_COMMAND_DEF("mixer", "configure mixer", "list\r\n\t<name>", cliMixer),
#endif
CLI_COMMAND_DEF("mmix", "custom motor mixer", NULL, cliMotorMix),
#ifdef LED_STRIP
CLI_COMMAND_DEF("mode_color", "configure mode and special colors", NULL, cliModeColor),
#endif
CLI_COMMAND_DEF("motor", "get/set motor",
"<index> [<value>]", cliMotor),
CLI_COMMAND_DEF("motor", "get/set motor", "<index> [<value>]", cliMotor),
CLI_COMMAND_DEF("name", "name of craft", NULL, cliName),
#if (FLASH_SIZE > 128)
CLI_COMMAND_DEF("play_sound", NULL,
"[<index>]", cliPlaySound),
CLI_COMMAND_DEF("play_sound", NULL, "[<index>]", cliPlaySound),
#endif
CLI_COMMAND_DEF("profile", "change profile",
"[<index>]", cliProfile),
CLI_COMMAND_DEF("profile", "change profile", "[<index>]", cliProfile),
CLI_COMMAND_DEF("rateprofile", "change rate profile", "[<index>]", cliRateProfile),
#if (FLASH_SIZE > 64)
CLI_COMMAND_DEF("resource", "view currently used resources", NULL, cliResource),
#if defined(USE_RESOURCE_MGMT)
CLI_COMMAND_DEF("resource", "show/set resources", NULL, cliResource),
#endif
CLI_COMMAND_DEF("rxfail", "show/set rx failsafe settings", NULL, cliRxFail),
CLI_COMMAND_DEF("rxrange", "configure rx channel ranges", NULL, cliRxRange),

View File

@ -59,7 +59,7 @@
#define SERIAL_RX
#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_IBUS // FlySky and Turnigy receivers
#define USE_SERIALRX_SUMD // Graupner Hott protocol
@ -89,6 +89,7 @@
#define TELEMETRY_LTM
#define TELEMETRY_SMARTPORT
#define USE_SERVOS
#define USE_RESOURCE_MGMT
#endif
#if (FLASH_SIZE > 128)
@ -104,6 +105,7 @@
#define USE_SERIALRX_JETIEXBUS
#define VTX_CONTROL
#define VTX_SMARTAUDIO
#define USE_SENSOR_NAMES
#else
#define SKIP_CLI_COMMAND_HELP
#endif