mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Rename FLASHFS to USE_FLASHFS
This commit is contained in:
parent
3b8e05fb46
commit
6423ac7db1
7 changed files with 28 additions and 19 deletions
|
@ -606,7 +606,7 @@ static void validateBlackboxConfig()
|
|||
masterConfig.blackbox_rate_denom /= div;
|
||||
}
|
||||
|
||||
if (!(masterConfig.blackbox_device == BLACKBOX_DEVICE_SERIAL || masterConfig.blackbox_device == BLACKBOX_DEVICE_FLASH)) {
|
||||
if (masterConfig.blackbox_device >= BLACKBOX_DEVICE_END) {
|
||||
masterConfig.blackbox_device = BLACKBOX_DEVICE_SERIAL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ static uint32_t previousBaudRate;
|
|||
void blackboxWrite(uint8_t value)
|
||||
{
|
||||
switch (masterConfig.blackbox_device) {
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
case BLACKBOX_DEVICE_FLASH:
|
||||
flashfsWriteByte(value); // Write byte asynchronously
|
||||
break;
|
||||
|
@ -106,7 +106,7 @@ int blackboxPrint(const char *s)
|
|||
|
||||
switch (masterConfig.blackbox_device) {
|
||||
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
case BLACKBOX_DEVICE_FLASH:
|
||||
length = strlen(s);
|
||||
flashfsWrite((const uint8_t*) s, length, false); // Write asynchronously
|
||||
|
@ -412,7 +412,7 @@ void blackboxDeviceFlush(void)
|
|||
case BLACKBOX_DEVICE_SERIAL:
|
||||
//Presently a no-op on serial, as serial is continuously being drained out of its buffer
|
||||
break;
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
case BLACKBOX_DEVICE_FLASH:
|
||||
flashfsFlushSync();
|
||||
break;
|
||||
|
@ -455,7 +455,7 @@ bool blackboxDeviceOpen(void)
|
|||
|
||||
return blackboxPort != NULL;
|
||||
break;
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
case BLACKBOX_DEVICE_FLASH:
|
||||
if (flashfsGetSize() == 0 || isBlackboxDeviceFull()) {
|
||||
return false;
|
||||
|
@ -486,7 +486,7 @@ void blackboxDeviceClose(void)
|
|||
mspAllocateSerialPorts(&masterConfig.serialConfig);
|
||||
}
|
||||
break;
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
case BLACKBOX_DEVICE_FLASH:
|
||||
flashfsFlushSync();
|
||||
break;
|
||||
|
@ -500,7 +500,7 @@ bool isBlackboxDeviceIdle(void)
|
|||
case BLACKBOX_DEVICE_SERIAL:
|
||||
return isSerialTransmitBufferEmpty(blackboxPort);
|
||||
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
case BLACKBOX_DEVICE_FLASH:
|
||||
flashfsFlushSync();
|
||||
return true;
|
||||
|
@ -517,7 +517,7 @@ bool isBlackboxDeviceFull(void)
|
|||
case BLACKBOX_DEVICE_SERIAL:
|
||||
return false;
|
||||
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
case BLACKBOX_DEVICE_FLASH:
|
||||
return flashfsIsEOF();
|
||||
#endif
|
||||
|
|
|
@ -20,8 +20,17 @@
|
|||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define BLACKBOX_DEVICE_SERIAL 0
|
||||
#define BLACKBOX_DEVICE_FLASH 1
|
||||
#include "target.h"
|
||||
|
||||
typedef enum BlackboxDevice {
|
||||
BLACKBOX_DEVICE_SERIAL = 0,
|
||||
|
||||
#ifdef USE_FLASHFS
|
||||
BLACKBOX_DEVICE_FLASH,
|
||||
#endif
|
||||
|
||||
BLACKBOX_DEVICE_END
|
||||
} BlackboxDevice;
|
||||
|
||||
uint8_t blackboxWriteChunkSize;
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ static void cliColor(char *cmdline);
|
|||
static void cliMixer(char *cmdline);
|
||||
#endif
|
||||
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
static void cliFlashIdent(char *cmdline);
|
||||
static void cliFlashErase(char *cmdline);
|
||||
static void cliFlashWrite(char *cmdline);
|
||||
|
@ -174,7 +174,7 @@ const clicmd_t cmdTable[] = {
|
|||
{ "dump", "print configurable settings in a pastable form", cliDump },
|
||||
{ "exit", "", cliExit },
|
||||
{ "feature", "list or -val or val", cliFeature },
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
{ "flash_erase", "erase flash chip", cliFlashErase },
|
||||
{ "flash_ident", "get flash chip details", cliFlashIdent },
|
||||
{ "flash_read", "read text from the given address", cliFlashRead },
|
||||
|
@ -745,7 +745,7 @@ static void cliColor(char *cmdline)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
|
||||
static void cliFlashIdent(char *cmdline)
|
||||
{
|
||||
|
|
|
@ -534,7 +534,7 @@ reset:
|
|||
static void serializeDataflashSummaryReply(void)
|
||||
{
|
||||
headSerialReply(1 + 3 * 4);
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
const flashGeometry_t *geometry = flashfsGetGeometry();
|
||||
serialize8(flashfsIsReady() ? 1 : 0);
|
||||
serialize32(geometry->sectors);
|
||||
|
@ -548,7 +548,7 @@ static void serializeDataflashSummaryReply(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
static void serializeDataflashReadReply(uint32_t address, uint8_t size)
|
||||
{
|
||||
uint8_t buffer[128];
|
||||
|
@ -1201,7 +1201,7 @@ static bool processOutCommand(uint8_t cmdMSP)
|
|||
serializeDataflashSummaryReply();
|
||||
break;
|
||||
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
case MSP_DATAFLASH_READ:
|
||||
{
|
||||
uint32_t readAddress = read32();
|
||||
|
@ -1421,7 +1421,7 @@ static bool processInCommand(void)
|
|||
readEEPROM();
|
||||
break;
|
||||
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
case MSP_DATAFLASH_ERASE:
|
||||
flashfsEraseCompletely();
|
||||
break;
|
||||
|
|
|
@ -351,7 +351,7 @@ void init(void)
|
|||
initTelemetry();
|
||||
#endif
|
||||
|
||||
#ifdef FLASHFS
|
||||
#ifdef USE_FLASHFS
|
||||
#ifdef NAZE
|
||||
// naze32 rev5 and above have 16mbit of flash available
|
||||
m25p16_init();
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
#define MPU6500_CS_PIN NAZE_SPI_CS_PIN
|
||||
#define MPU6500_SPI_INSTANCE NAZE_SPI_INSTANCE
|
||||
|
||||
#define FLASHFS
|
||||
#define USE_FLASHFS
|
||||
|
||||
#define USE_FLASH_M25P16
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue