mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 09:16:01 +03:00
Merge pull request #7695 from JulioCesarMatias/FixMemFlashExt
[cli.c] Fix external Flash Memory
This commit is contained in:
commit
34dfa1fc92
1 changed files with 12 additions and 0 deletions
|
@ -2248,6 +2248,11 @@ static void cliFlashInfo(char *cmdline)
|
|||
UNUSED(cmdline);
|
||||
|
||||
const flashGeometry_t *layout = flashGetGeometry();
|
||||
|
||||
if (layout->totalSize == 0) {
|
||||
cliPrintLine("Flash not available");
|
||||
return;
|
||||
}
|
||||
|
||||
cliPrintLinef("Flash sectors=%u, sectorSize=%u, pagesPerSector=%u, pageSize=%u, totalSize=%u",
|
||||
layout->sectors, layout->sectorSize, layout->pagesPerSector, layout->pageSize, layout->totalSize);
|
||||
|
@ -2277,6 +2282,13 @@ static void cliFlashErase(char *cmdline)
|
|||
{
|
||||
UNUSED(cmdline);
|
||||
|
||||
const flashGeometry_t *layout = flashGetGeometry();
|
||||
|
||||
if (layout->totalSize == 0) {
|
||||
cliPrintLine("Flash not available");
|
||||
return;
|
||||
}
|
||||
|
||||
cliPrintLine("Erasing...");
|
||||
flashfsEraseCompletely();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue