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;
|
break;
|
||||||
#ifdef USE_FLASHFS
|
#ifdef USE_FLASHFS
|
||||||
case BLACKBOX_DEVICE_FLASH:
|
case BLACKBOX_DEVICE_FLASH:
|
||||||
if (flashfsGetSize() == 0 || isBlackboxDeviceFull()) {
|
if (!flashfsIsSupported() || isBlackboxDeviceFull()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ static void cmsx_Blackbox_GetDeviceStatus(void)
|
||||||
case BLACKBOX_DEVICE_FLASH:
|
case BLACKBOX_DEVICE_FLASH:
|
||||||
unit = "KB";
|
unit = "KB";
|
||||||
|
|
||||||
storageDeviceIsWorking = flashfsIsReady();
|
storageDeviceIsWorking = flashfsIsSupported();
|
||||||
if (storageDeviceIsWorking) {
|
if (storageDeviceIsWorking) {
|
||||||
tfp_sprintf(cmsx_BlackboxStatus, "READY");
|
tfp_sprintf(cmsx_BlackboxStatus, "READY");
|
||||||
|
|
||||||
|
@ -150,6 +150,10 @@ static long cmsx_EraseFlash(displayPort_t *pDisplay, const void *ptr)
|
||||||
{
|
{
|
||||||
UNUSED(ptr);
|
UNUSED(ptr);
|
||||||
|
|
||||||
|
if (!flashfsIsSupported()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
displayClearScreen(pDisplay);
|
displayClearScreen(pDisplay);
|
||||||
displayWrite(pDisplay, 5, 3, "ERASING FLASH...");
|
displayWrite(pDisplay, 5, 3, "ERASING FLASH...");
|
||||||
displayResync(pDisplay); // Was max7456RefreshAll(); Why at this timing?
|
displayResync(pDisplay); // Was max7456RefreshAll(); Why at this timing?
|
||||||
|
|
|
@ -2057,6 +2057,10 @@ static void cliFlashErase(char *cmdline)
|
||||||
{
|
{
|
||||||
UNUSED(cmdline);
|
UNUSED(cmdline);
|
||||||
|
|
||||||
|
if (!flashfsIsSupported()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef MINIMAL_CLI
|
#ifndef MINIMAL_CLI
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
cliPrintLine("Erasing, please wait ... ");
|
cliPrintLine("Erasing, please wait ... ");
|
||||||
|
|
|
@ -1275,7 +1275,7 @@ static void osdGetBlackboxStatusString(char * buff)
|
||||||
|
|
||||||
#ifdef USE_FLASHFS
|
#ifdef USE_FLASHFS
|
||||||
case BLACKBOX_DEVICE_FLASH:
|
case BLACKBOX_DEVICE_FLASH:
|
||||||
storageDeviceIsWorking = flashfsIsReady();
|
storageDeviceIsWorking = flashfsIsSupported();
|
||||||
if (storageDeviceIsWorking) {
|
if (storageDeviceIsWorking) {
|
||||||
const flashGeometry_t *geometry = flashfsGetGeometry();
|
const flashGeometry_t *geometry = flashfsGetGeometry();
|
||||||
storageTotal = geometry->totalSize / 1024;
|
storageTotal = geometry->totalSize / 1024;
|
||||||
|
|
Loading…
Reference in New Issue