Generalised USB MSC use for all F4 targets with SD card. (#5519)

This commit is contained in:
Michael Keller 2018-03-24 16:00:53 +13:00 committed by GitHub
parent 79debdc993
commit a8e86880f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 20 additions and 11 deletions

View File

@ -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

View File

@ -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)),)

View File

@ -26,7 +26,7 @@
#include "platform.h"
#ifdef USB_MSC
#ifdef USE_USB_MSC
#include "build/build_config.h"

View File

@ -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();

View File

@ -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
};

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -102,3 +102,7 @@
#ifndef USE_ADC
#undef USE_ADC_INTERNAL
#endif
#if !defined(USE_SDCARD)
#undef USE_USB_MSC
#endif

View File

@ -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