Merge pull request #3520 from DanNixon/cms_bb_flash_reset_status_after_erase
Ensure storage device status is reset after erasing flash via CMS
This commit is contained in:
commit
f249bc93fa
|
@ -52,29 +52,6 @@
|
|||
#include "io/flashfs.h"
|
||||
#include "io/beeper.h"
|
||||
|
||||
|
||||
#ifdef USE_FLASHFS
|
||||
static long cmsx_EraseFlash(displayPort_t *pDisplay, const void *ptr)
|
||||
{
|
||||
UNUSED(ptr);
|
||||
|
||||
displayClearScreen(pDisplay);
|
||||
displayWrite(pDisplay, 5, 3, "ERASING FLASH...");
|
||||
displayResync(pDisplay); // Was max7456RefreshAll(); Why at this timing?
|
||||
|
||||
flashfsEraseCompletely();
|
||||
while (!flashfsIsReady()) {
|
||||
delay(100);
|
||||
}
|
||||
|
||||
beeper(BEEPER_BLACKBOX_ERASE);
|
||||
displayClearScreen(pDisplay);
|
||||
displayResync(pDisplay); // Was max7456RefreshAll(); wedges during heavy SPI?
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif // USE_FLASHFS
|
||||
|
||||
static const char * const cmsx_BlackboxDeviceNames[] = {
|
||||
"NONE",
|
||||
"FLASH ",
|
||||
|
@ -163,6 +140,31 @@ static void cmsx_Blackbox_GetDeviceStatus()
|
|||
tfp_sprintf(cmsx_BlackboxDeviceStorageFree, "%ld%s", storageFree, unit);
|
||||
}
|
||||
|
||||
#ifdef USE_FLASHFS
|
||||
static long cmsx_EraseFlash(displayPort_t *pDisplay, const void *ptr)
|
||||
{
|
||||
UNUSED(ptr);
|
||||
|
||||
displayClearScreen(pDisplay);
|
||||
displayWrite(pDisplay, 5, 3, "ERASING FLASH...");
|
||||
displayResync(pDisplay); // Was max7456RefreshAll(); Why at this timing?
|
||||
|
||||
flashfsEraseCompletely();
|
||||
while (!flashfsIsReady()) {
|
||||
delay(100);
|
||||
}
|
||||
|
||||
beeper(BEEPER_BLACKBOX_ERASE);
|
||||
displayClearScreen(pDisplay);
|
||||
displayResync(pDisplay); // Was max7456RefreshAll(); wedges during heavy SPI?
|
||||
|
||||
// Update storage device status to show new used space amount
|
||||
cmsx_Blackbox_GetDeviceStatus();
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif // USE_FLASHFS
|
||||
|
||||
static long cmsx_Blackbox_onEnter(void)
|
||||
{
|
||||
cmsx_Blackbox_GetDeviceStatus();
|
||||
|
|
Loading…
Reference in New Issue