From 47ce9bb7995b280eb2984b1715dcbbfbacff7ba5 Mon Sep 17 00:00:00 2001 From: blckmn Date: Thu, 9 Jun 2016 06:41:55 +1000 Subject: [PATCH] STM32F4: Adjusted for compatibility with @martinbudden common.h PR --- Makefile | 6 +++--- src/main/platform.h | 5 ++--- src/main/target/NAZE/target.h | 3 +++ src/main/{platform => target}/common.h | 16 ++++++++-------- src/main/{platform => target}/common_stm32f4xx.h | 0 src/main/{platform => target}/system_stm32f30x.c | 0 src/main/{platform => target}/system_stm32f30x.h | 0 src/main/{platform => target}/system_stm32f4xx.c | 0 src/main/{platform => target}/system_stm32f4xx.h | 0 9 files changed, 16 insertions(+), 14 deletions(-) rename src/main/{platform => target}/common.h (84%) rename src/main/{platform => target}/common_stm32f4xx.h (100%) rename src/main/{platform => target}/system_stm32f30x.c (100%) rename src/main/{platform => target}/system_stm32f30x.h (100%) rename src/main/{platform => target}/system_stm32f4xx.c (100%) rename src/main/{platform => target}/system_stm32f4xx.h (100%) diff --git a/Makefile b/Makefile index adf5c5025..6c17e574e 100644 --- a/Makefile +++ b/Makefile @@ -110,7 +110,7 @@ OBJECT_DIR = $(ROOT)/obj/main BIN_DIR = $(ROOT)/obj CMSIS_DIR = $(ROOT)/lib/main/CMSIS INCLUDE_DIRS = $(SRC_DIR) \ - $(ROOT)/src/main/platform + $(ROOT)/src/main/target LINKER_DIR = $(ROOT)/src/main/target # Search path for sources @@ -508,7 +508,7 @@ STM32F10x_COMMON_SRC = \ STM32F30x_COMMON_SRC = \ startup_stm32f30x_md_gcc.S \ - platform/system_stm32f30x.c \ + target/system_stm32f30x.c \ drivers/adc_stm32f30x.c \ drivers/bus_i2c_stm32f30x.c \ drivers/display_ug2864hsweg01.c \ @@ -520,7 +520,7 @@ STM32F30x_COMMON_SRC = \ STM32F4xx_COMMON_SRC = \ startup_stm32f40xx.s \ - platform/system_stm32f4xx.c \ + target/system_stm32f4xx.c \ drivers/accgyro_mpu.c \ drivers/adc_stm32f4xx.c \ drivers/adc_stm32f4xx.c \ diff --git a/src/main/platform.h b/src/main/platform.h index 3827278d5..b3ead5a6c 100644 --- a/src/main/platform.h +++ b/src/main/platform.h @@ -17,14 +17,12 @@ #pragma once -#include "platform/common.h" - #if defined(STM32F40_41xxx) || defined (STM32F411xE) #include "stm32f4xx_conf.h" #include "stm32f4xx_rcc.h" #include "stm32f4xx_gpio.h" #include "core_cm4.h" -#include "common_stm32f4xx.h" +#include "target/common_stm32f4xx.h" // Chip Unique ID on F405 #define U_ID_0 (*(uint32_t*)0x1fff7a10) @@ -62,5 +60,6 @@ #define STM32F1 #endif // STM32F10X +#include "target/common.h" #include "target.h" diff --git a/src/main/target/NAZE/target.h b/src/main/target/NAZE/target.h index eab30f68d..75d8cea8c 100644 --- a/src/main/target/NAZE/target.h +++ b/src/main/target/NAZE/target.h @@ -20,6 +20,9 @@ #define TARGET_BOARD_IDENTIFIER "AFNA" // AFroNAze - NAZE might be considered misleading on Naze clones like the flip32. #define USE_HARDWARE_REVISION_DETECTION +/* remove some options from common.h due to flash size */ +#undef GPS + #define BOARD_HAS_VOLTAGE_DIVIDER #define LED0 PB3 // PB3 (LED) diff --git a/src/main/platform/common.h b/src/main/target/common.h similarity index 84% rename from src/main/platform/common.h rename to src/main/target/common.h index 52d13c68e..5f5b99882 100644 --- a/src/main/platform/common.h +++ b/src/main/target/common.h @@ -17,17 +17,17 @@ #pragma once -//#define USE_SERVOS +#define USE_SERVOS #define USE_CLI #define SERIAL_RX #define BLACKBOX #if (FLASH_SIZE > 64) -//#define GPS -//#define GPS_PROTO_NMEA -//#define GPS_PROTO_UBLOX -//#define GPS_PROTO_I2C_NAV -//#define GPS_PROTO_NAZA +#define GPS +#define GPS_PROTO_NMEA +#define GPS_PROTO_UBLOX +#define GPS_PROTO_I2C_NAV +#define GPS_PROTO_NAZA #define TELEMETRY #define TELEMETRY_FRSKY @@ -37,8 +37,8 @@ #endif #if (FLASH_SIZE > 128) -//#define DISPLAY -//#define DISPLAY_ARMED_BITMAP +#define DISPLAY +#define DISPLAY_ARMED_BITMAP #else #define SKIP_CLI_COMMAND_HELP #define SKIP_RX_MSP diff --git a/src/main/platform/common_stm32f4xx.h b/src/main/target/common_stm32f4xx.h similarity index 100% rename from src/main/platform/common_stm32f4xx.h rename to src/main/target/common_stm32f4xx.h diff --git a/src/main/platform/system_stm32f30x.c b/src/main/target/system_stm32f30x.c similarity index 100% rename from src/main/platform/system_stm32f30x.c rename to src/main/target/system_stm32f30x.c diff --git a/src/main/platform/system_stm32f30x.h b/src/main/target/system_stm32f30x.h similarity index 100% rename from src/main/platform/system_stm32f30x.h rename to src/main/target/system_stm32f30x.h diff --git a/src/main/platform/system_stm32f4xx.c b/src/main/target/system_stm32f4xx.c similarity index 100% rename from src/main/platform/system_stm32f4xx.c rename to src/main/target/system_stm32f4xx.c diff --git a/src/main/platform/system_stm32f4xx.h b/src/main/target/system_stm32f4xx.h similarity index 100% rename from src/main/platform/system_stm32f4xx.h rename to src/main/target/system_stm32f4xx.h