Use the define USE_FLASH_M25P16. Only USE_FLASHTOOLS for some
development targets.
This commit is contained in:
parent
cc06113c8f
commit
676b2dd6c0
6
Makefile
6
Makefile
|
@ -301,6 +301,7 @@ NAZE_SRC = startup_stm32f10x_md_gcc.S \
|
|||
drivers/bus_i2c_stm32f10x.c \
|
||||
drivers/compass_hmc5883l.c \
|
||||
drivers/display_ug2864hsweg01.h \
|
||||
drivers/flash_m25p16.c \
|
||||
drivers/gpio_stm32f10x.c \
|
||||
drivers/inverter.c \
|
||||
drivers/light_led_stm32f10x.c \
|
||||
|
@ -317,7 +318,6 @@ NAZE_SRC = startup_stm32f10x_md_gcc.S \
|
|||
drivers/system_stm32f10x.c \
|
||||
drivers/timer.c \
|
||||
drivers/timer_stm32f10x.c \
|
||||
drivers/flash_m25p16.c \
|
||||
io/flashfs.c \
|
||||
hardware_revision.c \
|
||||
$(HIGHEND_SRC) \
|
||||
|
@ -343,6 +343,7 @@ EUSTM32F103RC_SRC = startup_stm32f10x_hd_gcc.S \
|
|||
drivers/compass_ak8975.c \
|
||||
drivers/compass_hmc5883l.c \
|
||||
drivers/display_ug2864hsweg01.c \
|
||||
drivers/flash_m25p16.c \
|
||||
drivers/gpio_stm32f10x.c \
|
||||
drivers/inverter.c \
|
||||
drivers/light_led_stm32f10x.c \
|
||||
|
@ -359,6 +360,7 @@ EUSTM32F103RC_SRC = startup_stm32f10x_hd_gcc.S \
|
|||
drivers/system_stm32f10x.c \
|
||||
drivers/timer.c \
|
||||
drivers/timer_stm32f10x.c \
|
||||
io/flashfs.c \
|
||||
$(HIGHEND_SRC) \
|
||||
$(COMMON_SRC)
|
||||
|
||||
|
@ -434,6 +436,7 @@ CC3D_SRC = \
|
|||
drivers/bus_i2c_stm32f10x.c \
|
||||
drivers/compass_hmc5883l.c \
|
||||
drivers/display_ug2864hsweg01.c \
|
||||
drivers/flash_m25p16.c \
|
||||
drivers/gpio_stm32f10x.c \
|
||||
drivers/inverter.c \
|
||||
drivers/light_led_stm32f10x.c \
|
||||
|
@ -450,7 +453,6 @@ CC3D_SRC = \
|
|||
drivers/system_stm32f10x.c \
|
||||
drivers/timer.c \
|
||||
drivers/timer_stm32f10x.c \
|
||||
drivers/flash_m25p16.c \
|
||||
io/flashfs.c \
|
||||
$(HIGHEND_SRC) \
|
||||
$(COMMON_SRC) \
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef USE_FLASH_M25P16
|
||||
|
||||
#include "drivers/flash_m25p16.h"
|
||||
#include "drivers/bus_spi.h"
|
||||
#include "drivers/system.h"
|
||||
|
@ -308,3 +310,5 @@ const flashGeometry_t* m25p16_getGeometry()
|
|||
{
|
||||
return &geometry;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -136,9 +136,11 @@ static void cliMixer(char *cmdline);
|
|||
#ifdef USE_FLASHFS
|
||||
static void cliFlashInfo(char *cmdline);
|
||||
static void cliFlashErase(char *cmdline);
|
||||
#ifdef USE_FLASH_TOOLS
|
||||
static void cliFlashWrite(char *cmdline);
|
||||
static void cliFlashRead(char *cmdline);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// buffer
|
||||
static char cliBuffer[48];
|
||||
|
@ -224,8 +226,10 @@ const clicmd_t cmdTable[] = {
|
|||
#ifdef USE_FLASHFS
|
||||
CLI_COMMAND_DEF("flash_erase", "erase flash chip", NULL, cliFlashErase),
|
||||
CLI_COMMAND_DEF("flash_info", "show flash chip info", NULL, cliFlashInfo),
|
||||
#ifdef USE_FLASH_TOOLS
|
||||
CLI_COMMAND_DEF("flash_read", NULL, "<length> <address>", cliFlashRead),
|
||||
CLI_COMMAND_DEF("flash_write", NULL, "<address> <message>", cliFlashWrite),
|
||||
#endif
|
||||
#endif
|
||||
CLI_COMMAND_DEF("get", "get variable value",
|
||||
"[name]", cliGet),
|
||||
|
@ -1165,6 +1169,8 @@ static void cliFlashErase(char *cmdline)
|
|||
printf("Done.\r\n");
|
||||
}
|
||||
|
||||
#ifdef USE_FLASH_TOOLS
|
||||
|
||||
static void cliFlashWrite(char *cmdline)
|
||||
{
|
||||
uint32_t address = atoi(cmdline);
|
||||
|
@ -1219,6 +1225,7 @@ static void cliFlashRead(char *cmdline)
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void dumpValues(uint16_t mask)
|
||||
|
|
|
@ -446,10 +446,10 @@ void init(void)
|
|||
if (hardwareRevision == NAZE32_REV5) {
|
||||
m25p16_init();
|
||||
}
|
||||
#endif
|
||||
#if defined(SPRACINGF3) || defined(CC3D)
|
||||
#elif defined(USE_FLASH_M25P16)
|
||||
m25p16_init();
|
||||
#endif
|
||||
|
||||
flashfsInit();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -46,13 +46,25 @@
|
|||
#define INVERTER_PERIPHERAL RCC_APB2Periph_GPIOB
|
||||
#define INVERTER_USART USART2
|
||||
|
||||
#define MPU6000_CS_GPIO GPIOB
|
||||
#define MPU6000_CS_PIN GPIO_Pin_12
|
||||
#define MPU6000_SPI_INSTANCE SPI2
|
||||
#define USE_SPI
|
||||
#define USE_SPI_DEVICE_2
|
||||
|
||||
#define MPU6500_CS_GPIO GPIOB
|
||||
#define MPU6500_CS_PIN GPIO_Pin_12
|
||||
#define MPU6500_SPI_INSTANCE SPI2
|
||||
#define PORT103R_SPI_INSTANCE SPI2
|
||||
#define PORT103R_SPI_CS_GPIO GPIOB
|
||||
#define PORT103R_SPI_CS_PIN GPIO_Pin_12
|
||||
|
||||
// We either have this 16mbit flash chip on SPI or the MPU6500 acc/gyro depending on board revision:
|
||||
#define M25P16_CS_GPIO PORT103R_SPI_CS_GPIO
|
||||
#define M25P16_CS_PIN PORT103R_SPI_CS_PIN
|
||||
#define M25P16_SPI_INSTANCE PORT103R_SPI_INSTANCE
|
||||
|
||||
#define MPU6000_CS_GPIO PORT103R_SPI_CS_GPIO
|
||||
#define MPU6000_CS_PIN PORT103R_SPI_CS_PIN
|
||||
#define MPU6000_SPI_INSTANCE PORT103R_SPI_INSTANCE
|
||||
|
||||
#define MPU6500_CS_GPIO PORT103R_SPI_CS_GPIO
|
||||
#define MPU6500_CS_PIN PORT103R_SPI_CS_PIN
|
||||
#define MPU6500_SPI_INSTANCE PORT103R_SPI_INSTANCE
|
||||
|
||||
#define GYRO
|
||||
#define USE_FAKE_GYRO
|
||||
|
@ -80,6 +92,10 @@
|
|||
#define USE_MAG_HMC5883
|
||||
#define USE_MAG_AK8975
|
||||
|
||||
#define USE_FLASHFS
|
||||
#define USE_FLASHTOOLS
|
||||
#define USE_FLASH_M25P16
|
||||
|
||||
#define SONAR
|
||||
#define BEEPER
|
||||
#define LED0
|
||||
|
|
Loading…
Reference in New Issue