Generalised USB MSC use for all F4 targets with SD card. (#5519)
This commit is contained in:
parent
79debdc993
commit
a8e86880f5
|
@ -197,7 +197,13 @@ VCP_SRC = \
|
|||
endif
|
||||
|
||||
MSC_SRC = \
|
||||
drivers/usb_msc_f4xx.c
|
||||
drivers/usb_msc_f4xx.c \
|
||||
msc/usbd_msc_desc.c
|
||||
|
||||
ifneq ($(filter SDCARD,$(FEATURES)),)
|
||||
MSC_SRC += \
|
||||
msc/usbd_storage_sd_spi.c
|
||||
endif
|
||||
|
||||
DSP_LIB := $(ROOT)/lib/main/CMSIS/DSP
|
||||
DEVICE_FLAGS += -DARM_MATH_MATRIX_CHECK -DARM_MATH_ROUNDING -D__FPU_PRESENT=1 -DUNALIGNED_SUPPORT_DISABLE -DARM_MATH_CM4
|
||||
|
|
|
@ -382,7 +382,8 @@ SRC += \
|
|||
drivers/sdcard.c \
|
||||
drivers/sdcard_standard.c \
|
||||
io/asyncfatfs/asyncfatfs.c \
|
||||
io/asyncfatfs/fat_standard.c
|
||||
io/asyncfatfs/fat_standard.c \
|
||||
$(MSC_SRC)
|
||||
endif
|
||||
|
||||
ifneq ($(filter VCP,$(FEATURES)),)
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef USB_MSC
|
||||
#ifdef USE_USB_MSC
|
||||
|
||||
#include "build/build_config.h"
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
#include "drivers/usb_io.h"
|
||||
#include "drivers/vtx_rtc6705.h"
|
||||
#include "drivers/vtx_common.h"
|
||||
#ifdef USB_MSC
|
||||
#ifdef USE_USB_MSC
|
||||
#include "drivers/usb_msc.h"
|
||||
#endif
|
||||
|
||||
|
@ -453,7 +453,7 @@ void init(void)
|
|||
#endif
|
||||
#endif // USE_SPI
|
||||
|
||||
#ifdef USB_MSC
|
||||
#ifdef USE_USB_MSC
|
||||
/* MSC mode will start after init, but will not allow scheduler to run,
|
||||
* so there is no bottleneck in reading and writing data */
|
||||
mscButtonInit();
|
||||
|
|
|
@ -3723,7 +3723,7 @@ static void cliDiff(char *cmdline)
|
|||
printConfig(cmdline, true);
|
||||
}
|
||||
|
||||
#ifdef USB_MSC
|
||||
#ifdef USE_USB_MSC
|
||||
static void cliMsc(char *cmdline)
|
||||
{
|
||||
UNUSED(cmdline);
|
||||
|
@ -3872,7 +3872,7 @@ const clicmd_t cmdTable[] = {
|
|||
#ifdef USE_VTX_CONTROL
|
||||
CLI_COMMAND_DEF("vtx", "vtx channels on switch", NULL, cliVtx),
|
||||
#endif
|
||||
#ifdef USB_MSC
|
||||
#ifdef USE_USB_MSC
|
||||
CLI_COMMAND_DEF("msc", "switch into msc mode", NULL, cliMsc),
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
// GYRO section -- end
|
||||
|
||||
#define USE_VCP
|
||||
#define USB_MSC
|
||||
#define MSC_BUTTON PA0
|
||||
#define VBUS_SENSING_PIN PA9
|
||||
#define VBUS_SENSING_ENABLED
|
||||
|
|
|
@ -66,7 +66,6 @@
|
|||
#define INVERTER_PIN_UART3 PB12
|
||||
|
||||
#define USE_VCP
|
||||
#define USB_MSC
|
||||
#define USB_CDC_HID
|
||||
#define VBUS_SENSING_PIN PA9
|
||||
#define VBUS_SENSING_ENABLED
|
||||
|
|
|
@ -16,5 +16,4 @@ TARGET_SRC += \
|
|||
drivers/sdcard_standard.c \
|
||||
io/asyncfatfs/asyncfatfs.c \
|
||||
io/asyncfatfs/fat_standard.c \
|
||||
msc/usbd_storage_sdio.c \
|
||||
msc/usbd_msc_desc.c
|
||||
msc/usbd_storage_sdio.c
|
||||
|
|
|
@ -102,3 +102,7 @@
|
|||
#ifndef USE_ADC
|
||||
#undef USE_ADC_INTERNAL
|
||||
#endif
|
||||
|
||||
#if !defined(USE_SDCARD)
|
||||
#undef USE_USB_MSC
|
||||
#endif
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
#define USE_GYRO_DATA_ANALYSE
|
||||
#define USE_ADC
|
||||
#define USE_ADC_INTERNAL
|
||||
#define USE_USB_MSC
|
||||
|
||||
#if defined(STM32F40_41xxx) || defined(STM32F411xE)
|
||||
#define USE_OVERCLOCK
|
||||
|
|
Loading…
Reference in New Issue