1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 11:59:58 +03:00

Merge pull request #9445 from mikeller/fix_sdcard_default

Fixed default for 'sdcard_mode' to 'none'.
This commit is contained in:
Michael Keller 2020-02-05 06:07:00 +13:00 committed by mikeller
parent 2332ee7b22
commit bc9715eece
9 changed files with 59 additions and 24 deletions

View file

@ -47,16 +47,12 @@ void pgResetFn_sdcardConfig(sdcardConfig_t *config)
config->device = SPI_DEV_TO_CFG(SPIINVALID);
config->mode = SDCARD_MODE_NONE;
#ifdef USE_SDCARD_SDIO
config->mode = SDCARD_MODE_SDIO;
config->useDma = true;
#endif
#ifdef USE_SDCARD_SPI
// These settings do not work for Unified Targets
// They are only left in place to support legacy targets
SPIDevice spidevice = spiDeviceByInstance(SDCARD_SPI_INSTANCE);
config->device = SPI_DEV_TO_CFG(spidevice);
config->chipSelectTag = IO_TAG(SDCARD_SPI_CS_PIN);
config->useDma = false;
if (spidevice != SPIINVALID && config->chipSelectTag) {
config->mode = SDCARD_MODE_SPI;

View file

@ -28,7 +28,8 @@
#include "config_helper.h"
#include "io/serial.h"
#include "pg/pg.h"
#include "pg/sdcard.h"
static targetSerialPortFunction_t targetSerialPortFunction[] = {
{ SERIAL_PORT_USART1, FUNCTION_MSP },
@ -38,5 +39,9 @@ static targetSerialPortFunction_t targetSerialPortFunction[] = {
void targetConfiguration(void)
{
targetSerialPortFunctionConfig(targetSerialPortFunction, ARRAYLEN(targetSerialPortFunction));
#if !defined(NUCLEOH743_RAMBASED)
sdcardConfigMutable()->mode = SDCARD_MODE_SDIO;
sdcardConfigMutable()->useDma = true;
#endif
}
#endif

View file

@ -1,9 +1,11 @@
H743xI_TARGETS += $(TARGET)
FEATURES += VCP ONBOARDFLASH SDCARD_SDIO
ifeq ($(TARGET), NUCLEOH743_RAMBASED)
FEATURES += VCP ONBOARDFLASH
RAM_BASED = yes
else
FEATURES += VCP ONBOARDFLASH SDCARD_SDIO
endif
# Top level Makefile adds, if not defined, HSE_VALUE, as default for F4 targets.
@ -30,7 +32,3 @@ TARGET_SRC = \
drivers/barometer/barometer_ms5611.c \
drivers/compass/compass_hmc5883l.c \
drivers/max7456.c \
# drivers/accgyro/accgyro_fake.c \
# drivers/barometer/barometer_fake.c \
# drivers/compass/compass_fake.c \

View file

@ -28,8 +28,10 @@
#include "config_helper.h"
#include "io/serial.h"
#include "osd/osd.h"
#include "pg/pg.h"
#include "pg/sdcard.h"
static targetSerialPortFunction_t targetSerialPortFunction[] = {
{ SERIAL_PORT_USART1, FUNCTION_MSP },
@ -40,5 +42,7 @@ void targetConfiguration(void)
{
osdConfigMutable()->core_temp_alarm = 85;
targetSerialPortFunctionConfig(targetSerialPortFunction, ARRAYLEN(targetSerialPortFunction));
sdcardConfigMutable()->mode = SDCARD_MODE_SDIO;
sdcardConfigMutable()->useDma = true;
}
#endif

View file

@ -28,8 +28,8 @@
#include "config_helper.h"
#include "io/serial.h"
#include "osd/osd.h"
#include "pg/pg.h"
static targetSerialPortFunction_t targetSerialPortFunction[] = {
{ SERIAL_PORT_USART1, FUNCTION_MSP },

View file

@ -170,17 +170,8 @@
// SD card not present on hardware, but pins are reserved.
//#define USE_SDCARD
#ifdef USE_SDCARD
#define USE_SDCARD_SDIO
#define SDCARD_DETECT_PIN PD10
#define SDCARD_DETECT_INVERTED
#define SDIO_DEVICE SDIODEV_1
#define SDIO_USE_4BIT true
#define SDIO_CK_PIN PC12
#define SDIO_CMD_PIN PD2
#define SDIO_D0_PIN PC8
#define SDIO_D1_PIN PC9
#define SDIO_D2_PIN PC10
#define SDIO_D3_PIN PC11
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
#else
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT

View file

@ -28,8 +28,10 @@
#include "config_helper.h"
#include "io/serial.h"
#include "osd/osd.h"
#include "pg/pg.h"
#include "pg/sdcard.h"
static targetSerialPortFunction_t targetSerialPortFunction[] = {
{ SERIAL_PORT_USART1, FUNCTION_MSP },
@ -40,5 +42,7 @@ void targetConfiguration(void)
{
osdConfigMutable()->core_temp_alarm = 85;
targetSerialPortFunctionConfig(targetSerialPortFunction, ARRAYLEN(targetSerialPortFunction));
sdcardConfigMutable()->mode = SDCARD_MODE_SDIO;
sdcardConfigMutable()->useDma = true;
}
#endif

View file

@ -0,0 +1,35 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdbool.h>
#include "platform.h"
#if defined(USE_TARGET_CONFIG)
#include "pg/sdcard.h"
void targetConfiguration(void)
{
sdcardConfigMutable()->mode = SDCARD_MODE_SDIO;
sdcardConfigMutable()->useDma = true;
}
#endif

View file

@ -32,6 +32,8 @@
#endif
#define USE_TARGET_CONFIGURATION
//LEDs
#if defined(PIRXF4)
#define LED0_PIN PC13