Skip to content

Commit

Permalink
Merge pull request betaflight#6261 from jflyper/bfdev-fix-non-rearming
Browse files Browse the repository at this point in the history
Call flashfsIsSupported instead of flashfsIsReady to check flash chip existence
  • Loading branch information
mikeller committed Jul 2, 2018
2 parents a324857 + 9d1e4db commit 463d7aa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/blackbox/blackbox_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ bool blackboxDeviceOpen(void)
break;
#ifdef USE_FLASHFS
case BLACKBOX_DEVICE_FLASH:
if (flashfsGetSize() == 0 || isBlackboxDeviceFull()) {
if (!flashfsIsSupported() || isBlackboxDeviceFull()) {
return false;
}

Expand Down
6 changes: 5 additions & 1 deletion src/main/cms/cms_menu_blackbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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?
Expand Down
4 changes: 4 additions & 0 deletions src/main/interface/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ... ");
Expand Down
2 changes: 1 addition & 1 deletion src/main/io/osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 463d7aa

Please sign in to comment.