Call flashfsIsSupported instead of flashfsIsReady to check flash chip existence
This commit is contained in:
parent
8e9e757448
commit
9d1e4db800
|
@ -259,7 +259,7 @@ bool blackboxDeviceOpen(void)
|
|||
break;
|
||||
#ifdef USE_FLASHFS
|
||||
case BLACKBOX_DEVICE_FLASH:
|
||||
if (flashfsGetSize() == 0 || isBlackboxDeviceFull()) {
|
||||
if (!flashfsIsSupported() || isBlackboxDeviceFull()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -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 ... ");
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue