From d78450eae8d24fefb17907fedc0438b7e8bd57a6 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 9 Aug 2011 01:19:05 -0500 Subject: [PATCH] Move some of the F2 defines into the makefile to make them global. Fixes some issues with grabbing the wrong stm32 configuration file. --- flight/Bootloaders/AHRS/ahrs_spi_program_slave.c | 2 +- flight/Bootloaders/INS/Makefile | 4 ++++ flight/Bootloaders/INS/ahrs_spi_program_slave.c | 2 +- flight/Bootloaders/INS/inc/pios_config.h | 3 --- flight/INS/Makefile | 4 ++++ flight/INS/inc/pios_config.h | 2 -- flight/Libraries/inc/fifo_buffer.h | 2 +- flight/PiOS/pios.h | 4 +--- .../OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj | 2 ++ 9 files changed, 14 insertions(+), 11 deletions(-) diff --git a/flight/Bootloaders/AHRS/ahrs_spi_program_slave.c b/flight/Bootloaders/AHRS/ahrs_spi_program_slave.c index 8fc3de482..6d5a1a4a2 100644 --- a/flight/Bootloaders/AHRS/ahrs_spi_program_slave.c +++ b/flight/Bootloaders/AHRS/ahrs_spi_program_slave.c @@ -29,7 +29,7 @@ #include "pios_opahrs_proto.h" #include "pios_spi.h" -#include "STM32103CB_AHRS.h" +#include "pios_board.h" #include "ahrs_bl.h" #include "ahrs_spi_program_slave.h" diff --git a/flight/Bootloaders/INS/Makefile b/flight/Bootloaders/INS/Makefile index 53e2c1a9f..e537c5322 100644 --- a/flight/Bootloaders/INS/Makefile +++ b/flight/Bootloaders/INS/Makefile @@ -237,7 +237,11 @@ ifeq ($(DEBUG),YES) CFLAGS = endif +# This is not the best place for these. Really should abstract out +# to the board file or something CFLAGS += -DHSE_VALUE=$(OSCILLATOR_FREQ) +CFLAGS += -DSTM32F2XX +CFLAGS += -DMEM_SIZE=1024000000 CFLAGS += -g$(DEBUGF) CFLAGS += -O$(OPT) diff --git a/flight/Bootloaders/INS/ahrs_spi_program_slave.c b/flight/Bootloaders/INS/ahrs_spi_program_slave.c index 8fc3de482..6d5a1a4a2 100644 --- a/flight/Bootloaders/INS/ahrs_spi_program_slave.c +++ b/flight/Bootloaders/INS/ahrs_spi_program_slave.c @@ -29,7 +29,7 @@ #include "pios_opahrs_proto.h" #include "pios_spi.h" -#include "STM32103CB_AHRS.h" +#include "pios_board.h" #include "ahrs_bl.h" #include "ahrs_spi_program_slave.h" diff --git a/flight/Bootloaders/INS/inc/pios_config.h b/flight/Bootloaders/INS/inc/pios_config.h index cc6b98d48..3d24f5399 100644 --- a/flight/Bootloaders/INS/inc/pios_config.h +++ b/flight/Bootloaders/INS/inc/pios_config.h @@ -27,9 +27,6 @@ #ifndef PIOS_CONFIG_H #define PIOS_CONFIG_H -#define STM32F2XX -#define MEM_SIZE 1024000000 - /* Enable/Disable PiOS Modules */ #define PIOS_INCLUDE_DELAY #define PIOS_INCLUDE_IRQ diff --git a/flight/INS/Makefile b/flight/INS/Makefile index 8a78b1db1..e3c9ea1e4 100644 --- a/flight/INS/Makefile +++ b/flight/INS/Makefile @@ -198,7 +198,11 @@ else CFLAGS += -Os endif +# This is not the best place for these. Really should abstract out +# to the board file or something CFLAGS += -DHSE_VALUE=$(OSCILLATOR_FREQ) +CFLAGS += -DSTM32F2XX +CFLAGS += -DMEM_SIZE=1024000000 # Output format. (can be ihex or binary or both) # binary to create a load-image in raw-binary format i.e. for SAM-BA, diff --git a/flight/INS/inc/pios_config.h b/flight/INS/inc/pios_config.h index a14c696dd..3526b48cb 100644 --- a/flight/INS/inc/pios_config.h +++ b/flight/INS/inc/pios_config.h @@ -36,8 +36,6 @@ #ifndef PIOS_CONFIG_H #define PIOS_CONFIG_H -#define STM32F2XX - /* Enable/Disable PiOS Modules */ #define PIOS_INCLUDE_DELAY #define PIOS_INCLUDE_I2C diff --git a/flight/Libraries/inc/fifo_buffer.h b/flight/Libraries/inc/fifo_buffer.h index cdc65c92f..6ba85877e 100644 --- a/flight/Libraries/inc/fifo_buffer.h +++ b/flight/Libraries/inc/fifo_buffer.h @@ -26,7 +26,7 @@ #ifndef _FIFO_BUFFER_H_ #define _FIFO_BUFFER_H_ -#include "pios.h" +#include "stdint.h" // ********************* diff --git a/flight/PiOS/pios.h b/flight/PiOS/pios.h index 624d122d7..cc1b2518a 100644 --- a/flight/PiOS/pios.h +++ b/flight/PiOS/pios.h @@ -46,14 +46,12 @@ #include #include +#include "pios_config.h" /* STM32 Std Perf Lib */ #if defined(STM32F2XX) #include -// XXX probably don't need this (header above gets it) -#include #else #include -#include #endif #if defined(PIOS_INCLUDE_SDCARD) diff --git a/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj b/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj index 1ab75e15a..e8017418c 100644 --- a/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj +++ b/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj @@ -2859,6 +2859,7 @@ 65C35F6812F0DC2D004811C2 /* attitude.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = attitude.h; sourceTree = ""; }; 65D2CA841248F9A400B1E7D6 /* mixersettings.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = mixersettings.xml; sourceTree = ""; }; 65D2CA851248F9A400B1E7D6 /* mixerstatus.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = mixerstatus.xml; sourceTree = ""; }; + 65DEA78513F0FE6000095B06 /* stm32f2xx_conf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stm32f2xx_conf.h; sourceTree = ""; }; 65E410AE12F65AEA00725888 /* attitudesettings.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = attitudesettings.xml; sourceTree = ""; }; 65E6DF7112E02E8E00058553 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; 65E6DF7312E02E8E00058553 /* alarms.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = alarms.c; sourceTree = ""; }; @@ -8179,6 +8180,7 @@ 65E8F03811EFF25C00BBF654 /* inc */ = { isa = PBXGroup; children = ( + 65DEA78513F0FE6000095B06 /* stm32f2xx_conf.h */, 6528CCE212E40F6700CF5144 /* pios_adxl345.h */, 65E8C745139A6D1A00E1F979 /* pios_crc.h */, 65E8F03A11EFF25C00BBF654 /* pios_adc.h */,