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
|
endif
|
||||||
|
|
||||||
MSC_SRC = \
|
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
|
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
|
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.c \
|
||||||
drivers/sdcard_standard.c \
|
drivers/sdcard_standard.c \
|
||||||
io/asyncfatfs/asyncfatfs.c \
|
io/asyncfatfs/asyncfatfs.c \
|
||||||
io/asyncfatfs/fat_standard.c
|
io/asyncfatfs/fat_standard.c \
|
||||||
|
$(MSC_SRC)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(filter VCP,$(FEATURES)),)
|
ifneq ($(filter VCP,$(FEATURES)),)
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
#ifdef USB_MSC
|
#ifdef USE_USB_MSC
|
||||||
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
#include "drivers/usb_io.h"
|
#include "drivers/usb_io.h"
|
||||||
#include "drivers/vtx_rtc6705.h"
|
#include "drivers/vtx_rtc6705.h"
|
||||||
#include "drivers/vtx_common.h"
|
#include "drivers/vtx_common.h"
|
||||||
#ifdef USB_MSC
|
#ifdef USE_USB_MSC
|
||||||
#include "drivers/usb_msc.h"
|
#include "drivers/usb_msc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ void init(void)
|
||||||
#endif
|
#endif
|
||||||
#endif // USE_SPI
|
#endif // USE_SPI
|
||||||
|
|
||||||
#ifdef USB_MSC
|
#ifdef USE_USB_MSC
|
||||||
/* MSC mode will start after init, but will not allow scheduler to run,
|
/* MSC mode will start after init, but will not allow scheduler to run,
|
||||||
* so there is no bottleneck in reading and writing data */
|
* so there is no bottleneck in reading and writing data */
|
||||||
mscButtonInit();
|
mscButtonInit();
|
||||||
|
|
|
@ -3723,7 +3723,7 @@ static void cliDiff(char *cmdline)
|
||||||
printConfig(cmdline, true);
|
printConfig(cmdline, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USB_MSC
|
#ifdef USE_USB_MSC
|
||||||
static void cliMsc(char *cmdline)
|
static void cliMsc(char *cmdline)
|
||||||
{
|
{
|
||||||
UNUSED(cmdline);
|
UNUSED(cmdline);
|
||||||
|
@ -3872,7 +3872,7 @@ const clicmd_t cmdTable[] = {
|
||||||
#ifdef USE_VTX_CONTROL
|
#ifdef USE_VTX_CONTROL
|
||||||
CLI_COMMAND_DEF("vtx", "vtx channels on switch", NULL, cliVtx),
|
CLI_COMMAND_DEF("vtx", "vtx channels on switch", NULL, cliVtx),
|
||||||
#endif
|
#endif
|
||||||
#ifdef USB_MSC
|
#ifdef USE_USB_MSC
|
||||||
CLI_COMMAND_DEF("msc", "switch into msc mode", NULL, cliMsc),
|
CLI_COMMAND_DEF("msc", "switch into msc mode", NULL, cliMsc),
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,7 +55,6 @@
|
||||||
// GYRO section -- end
|
// GYRO section -- end
|
||||||
|
|
||||||
#define USE_VCP
|
#define USE_VCP
|
||||||
#define USB_MSC
|
|
||||||
#define MSC_BUTTON PA0
|
#define MSC_BUTTON PA0
|
||||||
#define VBUS_SENSING_PIN PA9
|
#define VBUS_SENSING_PIN PA9
|
||||||
#define VBUS_SENSING_ENABLED
|
#define VBUS_SENSING_ENABLED
|
||||||
|
|
|
@ -66,7 +66,6 @@
|
||||||
#define INVERTER_PIN_UART3 PB12
|
#define INVERTER_PIN_UART3 PB12
|
||||||
|
|
||||||
#define USE_VCP
|
#define USE_VCP
|
||||||
#define USB_MSC
|
|
||||||
#define USB_CDC_HID
|
#define USB_CDC_HID
|
||||||
#define VBUS_SENSING_PIN PA9
|
#define VBUS_SENSING_PIN PA9
|
||||||
#define VBUS_SENSING_ENABLED
|
#define VBUS_SENSING_ENABLED
|
||||||
|
|
|
@ -16,5 +16,4 @@ TARGET_SRC += \
|
||||||
drivers/sdcard_standard.c \
|
drivers/sdcard_standard.c \
|
||||||
io/asyncfatfs/asyncfatfs.c \
|
io/asyncfatfs/asyncfatfs.c \
|
||||||
io/asyncfatfs/fat_standard.c \
|
io/asyncfatfs/fat_standard.c \
|
||||||
msc/usbd_storage_sdio.c \
|
msc/usbd_storage_sdio.c
|
||||||
msc/usbd_msc_desc.c
|
|
||||||
|
|
|
@ -102,3 +102,7 @@
|
||||||
#ifndef USE_ADC
|
#ifndef USE_ADC
|
||||||
#undef USE_ADC_INTERNAL
|
#undef USE_ADC_INTERNAL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(USE_SDCARD)
|
||||||
|
#undef USE_USB_MSC
|
||||||
|
#endif
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#define USE_GYRO_DATA_ANALYSE
|
#define USE_GYRO_DATA_ANALYSE
|
||||||
#define USE_ADC
|
#define USE_ADC
|
||||||
#define USE_ADC_INTERNAL
|
#define USE_ADC_INTERNAL
|
||||||
|
#define USE_USB_MSC
|
||||||
|
|
||||||
#if defined(STM32F40_41xxx) || defined(STM32F411xE)
|
#if defined(STM32F40_41xxx) || defined(STM32F411xE)
|
||||||
#define USE_OVERCLOCK
|
#define USE_OVERCLOCK
|
||||||
|
|
Loading…
Reference in New Issue