mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
Merge pull request #1786 from AndersHoglund/cli_printf_flush
Cli flash_erase print buffer flush and progress indicator added.
This commit is contained in:
commit
a78c264343
1 changed files with 19 additions and 2 deletions
|
@ -2252,18 +2252,35 @@ static void cliFlashInfo(char *cmdline)
|
|||
layout->sectors, layout->sectorSize, layout->pagesPerSector, layout->pageSize, layout->totalSize, flashfsGetOffset());
|
||||
}
|
||||
|
||||
|
||||
static void cliFlashErase(char *cmdline)
|
||||
{
|
||||
UNUSED(cmdline);
|
||||
|
||||
cliPrintf("Erasing...\r\n");
|
||||
#ifndef CLI_MINIMAL_VERBOSITY
|
||||
uint32_t i;
|
||||
cliPrintf("Erasing, please wait ... \r\n");
|
||||
#else
|
||||
cliPrintf("Erasing,\r\n");
|
||||
#endif
|
||||
|
||||
bufWriterFlush(cliWriter);
|
||||
flashfsEraseCompletely();
|
||||
|
||||
while (!flashfsIsReady()) {
|
||||
#ifndef CLI_MINIMAL_VERBOSITY
|
||||
cliPrintf(".");
|
||||
if (i++ > 120) {
|
||||
i=0;
|
||||
cliPrintf("\r\n");
|
||||
}
|
||||
|
||||
bufWriterFlush(cliWriter);
|
||||
#endif
|
||||
delay(100);
|
||||
}
|
||||
|
||||
cliPrintf("Done.\r\n");
|
||||
cliPrintf("\r\nDone.\r\n");
|
||||
}
|
||||
|
||||
#ifdef USE_FLASH_TOOLS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue