mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 05:45:31 +03:00
Fixed build issue for F1, and added dfu CLI command (for restart in DFU mode)
This commit is contained in:
parent
405d9f051a
commit
72a6e701eb
7 changed files with 54 additions and 9 deletions
|
@ -112,6 +112,7 @@ static void cliRxFail(char *cmdline);
|
|||
static void cliAdjustmentRange(char *cmdline);
|
||||
static void cliMotorMix(char *cmdline);
|
||||
static void cliDefaults(char *cmdline);
|
||||
void cliDfu(char *cmdLine);
|
||||
static void cliDump(char *cmdLine);
|
||||
void cliDumpProfile(uint8_t profileIndex);
|
||||
void cliDumpRateProfile(uint8_t rateProfileIndex) ;
|
||||
|
@ -122,6 +123,7 @@ static void cliPlaySound(char *cmdline);
|
|||
static void cliProfile(char *cmdline);
|
||||
static void cliRateProfile(char *cmdline);
|
||||
static void cliReboot(void);
|
||||
static void cliRebootEx(bool bootLoader);
|
||||
static void cliSave(char *cmdline);
|
||||
static void cliSerial(char *cmdline);
|
||||
#ifndef SKIP_SERIAL_PASSTHROUGH
|
||||
|
@ -263,8 +265,8 @@ const clicmd_t cmdTable[] = {
|
|||
CLI_COMMAND_DEF("color", "configure colors", NULL, cliColor),
|
||||
#endif
|
||||
CLI_COMMAND_DEF("defaults", "reset to defaults and reboot", NULL, cliDefaults),
|
||||
CLI_COMMAND_DEF("dump", "dump configuration",
|
||||
"[master|profile]", cliDump),
|
||||
CLI_COMMAND_DEF("dfu", "DFU mode on reboot", NULL, cliDfu),
|
||||
CLI_COMMAND_DEF("dump", "dump configuration", "[master|profile]", cliDump),
|
||||
CLI_COMMAND_DEF("exit", NULL, NULL, cliExit),
|
||||
CLI_COMMAND_DEF("feature", "configure features",
|
||||
"list\r\n"
|
||||
|
@ -2564,10 +2566,19 @@ static void cliRateProfile(char *cmdline) {
|
|||
|
||||
static void cliReboot(void)
|
||||
{
|
||||
cliPrint("\r\nRebooting");
|
||||
cliRebootEx(false);
|
||||
}
|
||||
|
||||
static void cliRebootEx(bool bootLoader)
|
||||
{
|
||||
cliPrint("\r\nRebooting");
|
||||
bufWriterFlush(cliWriter);
|
||||
waitForSerialPortToFinishTransmitting(cliPort);
|
||||
stopMotors();
|
||||
if (bootLoader) {
|
||||
systemResetToBootloader();
|
||||
return;
|
||||
}
|
||||
systemReset();
|
||||
}
|
||||
|
||||
|
@ -3107,6 +3118,13 @@ static void cliResource(char *cmdline)
|
|||
}
|
||||
}
|
||||
|
||||
void cliDfu(char *cmdLine)
|
||||
{
|
||||
UNUSED(cmdLine);
|
||||
cliPrint("\r\nRestarting in DFU mode");
|
||||
cliRebootEx(true);
|
||||
}
|
||||
|
||||
void cliInit(serialConfig_t *serialConfig)
|
||||
{
|
||||
UNUSED(serialConfig);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue