mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 12:25:20 +03:00
cli exit
command now reboots without saving.
This also prevents excessive wear to the eeprom/flash and makes it the difference between `save` obvious. Fixes #146
This commit is contained in:
parent
9224eaf71e
commit
8ed45bce36
1 changed files with 4 additions and 7 deletions
|
@ -90,6 +90,7 @@ static void cliMixer(char *cmdline);
|
||||||
static void cliMotor(char *cmdline);
|
static void cliMotor(char *cmdline);
|
||||||
static void cliProfile(char *cmdline);
|
static void cliProfile(char *cmdline);
|
||||||
static void cliRateProfile(char *cmdline);
|
static void cliRateProfile(char *cmdline);
|
||||||
|
static void cliReboot(void);
|
||||||
static void cliSave(char *cmdline);
|
static void cliSave(char *cmdline);
|
||||||
static void cliSet(char *cmdline);
|
static void cliSet(char *cmdline);
|
||||||
static void cliGet(char *cmdline);
|
static void cliGet(char *cmdline);
|
||||||
|
@ -858,18 +859,14 @@ static void cliEnter(void)
|
||||||
|
|
||||||
static void cliExit(char *cmdline)
|
static void cliExit(char *cmdline)
|
||||||
{
|
{
|
||||||
cliPrint("\r\nLeaving CLI mode\r\n");
|
UNUSED(cmdline);
|
||||||
|
cliPrint("\r\nLeaving CLI mode, unsaved changes lost.\r\n");
|
||||||
*cliBuffer = '\0';
|
*cliBuffer = '\0';
|
||||||
bufferIndex = 0;
|
bufferIndex = 0;
|
||||||
cliMode = 0;
|
cliMode = 0;
|
||||||
// incase a motor was left running during motortest, clear it here
|
// incase a motor was left running during motortest, clear it here
|
||||||
mixerResetMotors();
|
mixerResetMotors();
|
||||||
// save and reboot... I think this makes the most sense - otherwise config changes can be out of sync, maybe just need to applyConfig and return?
|
cliReboot();
|
||||||
#if 1
|
|
||||||
cliSave(cmdline);
|
|
||||||
#else
|
|
||||||
releaseSerialPort(cliPort, FUNCTION_CLI);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cliFeature(char *cmdline)
|
static void cliFeature(char *cmdline)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue