mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 14:55:21 +03:00
Cli flash_erase print buffer flush and progress indicator added.
This commit is contained in:
parent
5e308669d4
commit
cfc44df4ad
1 changed files with 12 additions and 2 deletions
|
@ -2252,18 +2252,28 @@ static void cliFlashInfo(char *cmdline)
|
||||||
layout->sectors, layout->sectorSize, layout->pagesPerSector, layout->pageSize, layout->totalSize, flashfsGetOffset());
|
layout->sectors, layout->sectorSize, layout->pagesPerSector, layout->pageSize, layout->totalSize, flashfsGetOffset());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void cliFlashErase(char *cmdline)
|
static void cliFlashErase(char *cmdline)
|
||||||
{
|
{
|
||||||
UNUSED(cmdline);
|
UNUSED(cmdline);
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
cliPrintf("Erasing...\r\n");
|
cliPrintf("Erasing, please wait ... \r\n");
|
||||||
|
bufWriterFlush(cliWriter);
|
||||||
flashfsEraseCompletely();
|
flashfsEraseCompletely();
|
||||||
|
|
||||||
while (!flashfsIsReady()) {
|
while (!flashfsIsReady()) {
|
||||||
|
cliPrintf(".");
|
||||||
|
if (i++ > 120) {
|
||||||
|
i=0;
|
||||||
|
cliPrintf("\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
bufWriterFlush(cliWriter);
|
||||||
delay(100);
|
delay(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
cliPrintf("Done.\r\n");
|
cliPrintf("\r\nDone.\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_FLASH_TOOLS
|
#ifdef USE_FLASH_TOOLS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue