Skip to content

Commit

Permalink
Reinitialise flashFs after erasing flash chip.
Browse files Browse the repository at this point in the history
Ensures erase actually worked rather than assuming it did.
  • Loading branch information
hydra authored and ezshinoda committed May 9, 2019
1 parent cfcd528 commit e9b6664
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/cli/cli.c
Expand Up @@ -2288,6 +2288,7 @@ static void cliFlashErase(char *cmdline)

bufWriterFlush(cliWriter);
flashfsEraseCompletely();
flashfsInit();

while (!flashfsIsReady()) {
#ifndef MINIMAL_CLI
Expand Down
1 change: 1 addition & 0 deletions src/main/msp/msp.c
Expand Up @@ -2342,6 +2342,7 @@ static mspResult_e mspProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
#ifdef USE_FLASHFS
case MSP_DATAFLASH_ERASE:
flashfsEraseCompletely();
flashfsInit();
break;
#endif

Expand Down

0 comments on commit e9b6664

Please sign in to comment.