1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 04:15:44 +03:00

Reinitialise flashFs after erasing flash chip.

Ensures erase actually worked rather than assuming it did.
This commit is contained in:
Dominic Clifton 2018-11-30 15:52:26 +01:00 committed by jflyper
parent cfcd528a87
commit e9b666421a
2 changed files with 2 additions and 0 deletions

View file

@ -2288,6 +2288,7 @@ static void cliFlashErase(char *cmdline)
bufWriterFlush(cliWriter); bufWriterFlush(cliWriter);
flashfsEraseCompletely(); flashfsEraseCompletely();
flashfsInit();
while (!flashfsIsReady()) { while (!flashfsIsReady()) {
#ifndef MINIMAL_CLI #ifndef MINIMAL_CLI

View file

@ -2342,6 +2342,7 @@ static mspResult_e mspProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
#ifdef USE_FLASHFS #ifdef USE_FLASHFS
case MSP_DATAFLASH_ERASE: case MSP_DATAFLASH_ERASE:
flashfsEraseCompletely(); flashfsEraseCompletely();
flashfsInit();
break; break;
#endif #endif