1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00

Allow CLI to be compiled out.

First cut, as proof-of-concept.  This allows CJMCU target to be built
without CLI and with Blackbox.
This commit is contained in:
Dominic Clifton 2015-05-19 23:42:41 +01:00
parent 67c6967da7
commit d0a9d14b87
15 changed files with 35 additions and 6 deletions

View file

@ -346,11 +346,13 @@ void serialInit(serialConfig_t *initialSerialConfig, bool softserialEnabled)
void handleSerial(void)
{
#ifdef USE_CLI
// in cli mode, all serial stuff goes to here. enter cli mode by sending #
if (cliMode) {
cliProcess();
return;
}
#endif
mspProcess();
}
@ -366,9 +368,14 @@ void cliEnter(serialPort_t *serialPort);
void evaluateOtherData(serialPort_t *serialPort, uint8_t receivedChar)
{
#ifndef USE_CLI
UNUSED(serialPort);
#else
if (receivedChar == '#') {
cliEnter(serialPort);
} else if (receivedChar == serialConfig->reboot_character) {
}
#endif
if (receivedChar == serialConfig->reboot_character) {
systemResetToBootloader();
}
}

View file

@ -84,6 +84,12 @@
#include "serial_cli.h"
// FIXME remove this for targets that don't need a CLI. Perhaps use a no-op macro when USE_CLI is not enabled
// signal that we're in cli mode
uint8_t cliMode = 0;
#ifdef USE_CLI
extern uint16_t cycleTime; // FIXME dependency on mw.c
void gpsEnablePassthrough(serialPort_t *gpsPassthroughPort);
@ -132,9 +138,6 @@ static void cliFlashWrite(char *cmdline);
static void cliFlashRead(char *cmdline);
#endif
// signal that we're in cli mode
uint8_t cliMode = 0;
// buffer
static char cliBuffer[48];
static uint32_t bufferIndex = 0;
@ -1767,3 +1770,4 @@ void cliInit(serialConfig_t *serialConfig)
{
UNUSED(serialConfig);
}
#endif

View file

@ -347,7 +347,10 @@ void init(void)
imuInit();
mspInit(&masterConfig.serialConfig);
#ifdef USE_CLI
cliInit(&masterConfig.serialConfig);
#endif
failsafeInit(&masterConfig.rxConfig);

View file

@ -116,7 +116,7 @@
//#define DISPLAY
#define AUTOTUNE
#define USE_SERVOS
#define USE_CLI
#define SPEKTRUM_BIND
// USART2, PA3

View file

@ -113,6 +113,7 @@
#define SERIAL_RX
#define AUTOTUNE
#define USE_SERVOS
#define USE_CLI
#if defined(OPBL)
#undef AUTOTUNE // disabled for OPBL build due to code size.

View file

@ -123,3 +123,4 @@
#define SERIAL_RX
#define AUTOTUNE
#define USE_SERVOS
#define USE_CLI

View file

@ -59,6 +59,7 @@
#define SERIAL_RX
//#define USE_SERVOS
#define USE_CLI
#define SPEKTRUM_BIND
// USART2, PA3
@ -68,6 +69,10 @@
// Since the CJMCU PCB has holes for 4 motors in each corner we can save same flash space by disabling support for other mixers.
#define USE_QUAD_MIXER_ONLY
#if (FLASH_SIZE > 64)
#define BLACKBOX
#endif
//#undef USE_CLI
//#define BLACKBOX

View file

@ -125,6 +125,7 @@
#define SERIAL_RX
#define AUTOTUNE
#define USE_SERVOS
#define USE_CLI
#define SPEKTRUM_BIND
// USART2, PA3

View file

@ -165,6 +165,7 @@
#define SERIAL_RX
#define AUTOTUNE
#define USE_SERVOS
#define USE_CLI
#define SPEKTRUM_BIND
// USART2, PA3

View file

@ -46,6 +46,7 @@
#define SERIAL_RX
#define AUTOTUNE
#define USE_SERVOS
#define USE_CLI
#define SPEKTRUM_BIND
// USART2, PA3

View file

@ -112,3 +112,4 @@
#define AUTOTUNE
#define BLACKBOX
#define USE_SERVOS
#define USE_CLI

View file

@ -136,3 +136,4 @@
#define SERIAL_RX
#define AUTOTUNE
#define USE_SERVOS
#define USE_CLI

View file

@ -109,11 +109,12 @@
#define AUTOTUNE
#define BLACKBOX
#define TELEMETRY
#define SERIAL_RX
#define GPS
#define DISPLAY
#define USE_SERVOS
#define TELEMETRY
#define USE_CLI
#define LED_STRIP
#if 1

View file

@ -153,3 +153,4 @@
#define AUTOTUNE
#define DISPLAY
#define USE_SERVOS
#define USE_CLI

View file

@ -97,3 +97,4 @@
#define SERIAL_RX
#define AUTOTUNE
#define USE_SERVOS
#define USE_CLI