Call flashfsIsSupported instead of flashfsIsReady to check flash chip existence

This commit is contained in:
jflyper 2018-07-02 09:46:54 +09:00
parent 8e9e757448
commit 9d1e4db800
4 changed files with 11 additions and 3 deletions

View File

@ -259,7 +259,7 @@ bool blackboxDeviceOpen(void)
break;
#ifdef USE_FLASHFS
case BLACKBOX_DEVICE_FLASH:
if (flashfsGetSize() == 0 || isBlackboxDeviceFull()) {
if (!flashfsIsSupported() || isBlackboxDeviceFull()) {
return false;
}

View File

@ -122,7 +122,7 @@ static void cmsx_Blackbox_GetDeviceStatus(void)
case BLACKBOX_DEVICE_FLASH:
unit = "KB";
storageDeviceIsWorking = flashfsIsReady();
storageDeviceIsWorking = flashfsIsSupported();
if (storageDeviceIsWorking) {
tfp_sprintf(cmsx_BlackboxStatus, "READY");
@ -150,6 +150,10 @@ static long cmsx_EraseFlash(displayPort_t *pDisplay, const void *ptr)
{
UNUSED(ptr);
if (!flashfsIsSupported()) {
return 0;
}
displayClearScreen(pDisplay);
displayWrite(pDisplay, 5, 3, "ERASING FLASH...");
displayResync(pDisplay); // Was max7456RefreshAll(); Why at this timing?

View File

@ -2057,6 +2057,10 @@ static void cliFlashErase(char *cmdline)
{
UNUSED(cmdline);
if (!flashfsIsSupported()) {
return;
}
#ifndef MINIMAL_CLI
uint32_t i = 0;
cliPrintLine("Erasing, please wait ... ");

View File

@ -1275,7 +1275,7 @@ static void osdGetBlackboxStatusString(char * buff)
#ifdef USE_FLASHFS
case BLACKBOX_DEVICE_FLASH:
storageDeviceIsWorking = flashfsIsReady();
storageDeviceIsWorking = flashfsIsSupported();
if (storageDeviceIsWorking) {
const flashGeometry_t *geometry = flashfsGetGeometry();
storageTotal = geometry->totalSize / 1024;