Merge pull request #2494 from blckmn/bb_enum_dedupe
Removing duplicate bb device enum
This commit is contained in:
commit
b8317f53c6
10
Makefile
10
Makefile
|
@ -101,9 +101,9 @@ HSE_VALUE ?= 8000000
|
|||
# used for turning on features like VCP and SDCARD
|
||||
FEATURES =
|
||||
|
||||
SAMPLE_TARGETS = ALIENFLIGHTF3 ALIENFLIGHTF4 ANYFCF7 BETAFLIGHTF3 BLUEJAYF4 CC3D FURYF4 NAZE REVO SIRINFPV SPARKY SPRACINGF3 SPRACINGF3EVO STM32F3DISCOVERY
|
||||
ALT_TARGETS = $(sort $(filter-out target, $(basename $(notdir $(wildcard $(ROOT)/src/main/target/*/*.mk)))))
|
||||
OPBL_TARGETS = $(filter %_OPBL, $(ALT_TARGETS))
|
||||
OFFICIAL_TARGETS = ALIENFLIGHTF3 ALIENFLIGHTF4 ANYFCF7 BETAFLIGHTF3 BLUEJAYF4 CC3D FURYF4 NAZE REVO SIRINFPV SPARKY SPRACINGF3 SPRACINGF3EVO STM32F3DISCOVERY
|
||||
ALT_TARGETS = $(sort $(filter-out target, $(basename $(notdir $(wildcard $(ROOT)/src/main/target/*/*.mk)))))
|
||||
OPBL_TARGETS = $(filter %_OPBL, $(ALT_TARGETS))
|
||||
|
||||
VALID_TARGETS = $(dir $(wildcard $(ROOT)/src/main/target/*/target.mk))
|
||||
VALID_TARGETS := $(subst /,, $(subst ./src/main/target/,, $(VALID_TARGETS)))
|
||||
|
@ -1095,8 +1095,8 @@ $(OBJECT_DIR)/$(TARGET)/%.o: %.S
|
|||
$(V1) echo "%% $(notdir $<)" "$(STDOUT)"
|
||||
$(V1) $(CROSS_CC) -c -o $@ $(ASFLAGS) $<
|
||||
|
||||
## sample : Build all sample (travis) targets
|
||||
sample: $(SAMPLE_TARGETS)
|
||||
## official : Build all official (travis) targets
|
||||
official: $(OFFICIAL_TARGETS)
|
||||
|
||||
## all : Build all valid targets
|
||||
all: $(VALID_TARGETS)
|
||||
|
|
|
@ -1657,8 +1657,12 @@ void handleBlackbox(timeUs_t currentTimeUs)
|
|||
|
||||
static bool canUseBlackboxWithCurrentConfiguration(void)
|
||||
{
|
||||
#ifdef USE_SDCARD
|
||||
return feature(FEATURE_BLACKBOX) &&
|
||||
(blackboxConfig()->device != BLACKBOX_SDCARD || feature(FEATURE_SDCARD));
|
||||
!(blackboxConfig()->device == BLACKBOX_DEVICE_SDCARD && !feature(FEATURE_SDCARD));
|
||||
#else
|
||||
return feature(FEATURE_BLACKBOX);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,11 +23,16 @@
|
|||
|
||||
#include "config/parameter_group.h"
|
||||
|
||||
typedef enum {
|
||||
BLACKBOX_SERIAL = 0,
|
||||
BLACKBOX_SPIFLASH,
|
||||
BLACKBOX_SDCARD
|
||||
} blackBoxDevice_e;
|
||||
typedef enum BlackboxDevice {
|
||||
BLACKBOX_DEVICE_SERIAL = 0,
|
||||
#ifdef USE_FLASHFS
|
||||
BLACKBOX_DEVICE_FLASH = 1,
|
||||
#endif
|
||||
#ifdef USE_SDCARD
|
||||
BLACKBOX_DEVICE_SDCARD = 2,
|
||||
#endif
|
||||
|
||||
} BlackboxDevice_e;
|
||||
|
||||
typedef struct blackboxConfig_s {
|
||||
uint8_t rate_num;
|
||||
|
|
|
@ -17,18 +17,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
typedef enum BlackboxDevice {
|
||||
BLACKBOX_DEVICE_SERIAL = 0,
|
||||
|
||||
#ifdef USE_FLASHFS
|
||||
BLACKBOX_DEVICE_FLASH = 1,
|
||||
#endif
|
||||
#ifdef USE_SDCARD
|
||||
BLACKBOX_DEVICE_SDCARD = 2,
|
||||
#endif
|
||||
|
||||
} BlackboxDevice;
|
||||
|
||||
typedef enum {
|
||||
BLACKBOX_RESERVE_SUCCESS,
|
||||
BLACKBOX_RESERVE_TEMPORARY_FAILURE,
|
||||
|
|
|
@ -501,7 +501,7 @@ void init(void)
|
|||
#endif
|
||||
|
||||
#ifdef USE_FLASHFS
|
||||
if (blackboxConfig()->device == BLACKBOX_SPIFLASH) {
|
||||
if (blackboxConfig()->device == BLACKBOX_DEVICE_FLASH) {
|
||||
#if defined(USE_FLASH_M25P16)
|
||||
m25p16_init(flashConfig());
|
||||
#endif
|
||||
|
@ -510,7 +510,7 @@ void init(void)
|
|||
#endif
|
||||
|
||||
#ifdef USE_SDCARD
|
||||
if (feature(FEATURE_SDCARD) && blackboxConfig()->device == BLACKBOX_SDCARD) {
|
||||
if (feature(FEATURE_SDCARD) && blackboxConfig()->device == BLACKBOX_DEVICE_SDCARD) {
|
||||
sdcardInsertionDetectInit();
|
||||
sdcard_init(sdcardConfig()->useDma);
|
||||
afatfs_init();
|
||||
|
|
Loading…
Reference in New Issue