diff --git a/flight/Makefile b/flight/Makefile index 07cc11dbe..5145fd769 100644 --- a/flight/Makefile +++ b/flight/Makefile @@ -53,10 +53,12 @@ BOARD = STM3210E_OP OUTDIR = Build # Target file name (without extension). -TARGET = openpilot +TARGET = OpenPilot # Paths -SYSDIR = sys +PIOS = PiOS +PIOSSTM32F10X = PiOS/STM32F10x +PIOSCOMMON = PiOS/Common APPLIBDIR = libraries STMLIBDIR = $(APPLIBDIR) STMSPDDIR = $(STMLIBDIR)/STM32F10x_StdPeriph_Driver @@ -77,16 +79,18 @@ RTOSINCDIR = $(RTOSSRCDIR)/include # use file-extension c for "c-only"-files ## PIOS: -SRC = $(SYSDIR)/pios.c +SRC = $(PIOS)/pios.c -## PIOS Hardware -SRC += $(SYSDIR)/pios_sys.c -SRC += $(SYSDIR)/pios_settings.c -SRC += $(SYSDIR)/pios_led.c -SRC += $(SYSDIR)/pios_uart.c -SRC += $(SYSDIR)/pios_irq.c -SRC += $(SYSDIR)/pios_com.c -SRC += $(SYSDIR)/printf-stdarg.c +## PIOS Hardware (STM32F10x) +SRC += $(PIOSSTM32F10X)/pios_sys.c +SRC += $(PIOSSTM32F10X)/pios_settings.c +SRC += $(PIOSSTM32F10X)/pios_led.c +SRC += $(PIOSSTM32F10X)/pios_uart.c +SRC += $(PIOSSTM32F10X)/pios_irq.c + +## PIOS Hardware (Common) +SRC += $(PIOSCOMMON)/pios_com.c +SRC += $(PIOSCOMMON)/printf-stdarg.c ## CMSIS for STM32 SRC += $(CMSISDIR)/core_cm3.c @@ -155,14 +159,15 @@ CPPSRCARM = # Even though the DOS/Win* filesystem matches both .s and .S the same, # it will preserve the spelling of the filenames, and gcc itself does # care about how the name is spelled on its command-line. -ASRC = $(SYSDIR)/startup_stm32f10x_$(MODEL).S +ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S # List Assembler source files here which must be assembled in ARM-Mode.. ASRCARM = # List any extra directories to look for include files here. # Each directory must be seperated by a space. -EXTRAINCDIRS = $(SYSDIR) +EXTRAINCDIRS = $(PIOSSTM32F10X) +EXTRAINCDIRS += $(PIOSCOMMON) EXTRAINCDIRS += $(STMSPDINCDIR) EXTRAINCDIRS += $(CMSISDIR) EXTRAINCDIRS += $(FATSDDIR) @@ -187,7 +192,7 @@ EXTRA_LIBDIRS = EXTRA_LIBS = # Path to Linker-Scripts -LINKERSCRIPTPATH = $(SYSDIR) +LINKERSCRIPTPATH = $(PIOSSTM32F10X) # Optimization level, can be [0, 1, 2, 3, s]. # 0 = turn off optimization. s = optimize for size. diff --git a/flight/sys/pios_com.h b/flight/PiOS/Common/inc/pios_com.h similarity index 100% rename from flight/sys/pios_com.h rename to flight/PiOS/Common/inc/pios_com.h diff --git a/flight/sys/pios_com.c b/flight/PiOS/Common/pios_com.c similarity index 100% rename from flight/sys/pios_com.c rename to flight/PiOS/Common/pios_com.c diff --git a/flight/sys/printf-stdarg.c b/flight/PiOS/Common/printf-stdarg.c similarity index 100% rename from flight/sys/printf-stdarg.c rename to flight/PiOS/Common/printf-stdarg.c diff --git a/flight/sys/FreeRTOSConfig.h b/flight/PiOS/STM32F10x/inc/FreeRTOSConfig.h similarity index 100% rename from flight/sys/FreeRTOSConfig.h rename to flight/PiOS/STM32F10x/inc/FreeRTOSConfig.h diff --git a/flight/sys/pios_board.h b/flight/PiOS/STM32F10x/inc/pios_board.h similarity index 100% rename from flight/sys/pios_board.h rename to flight/PiOS/STM32F10x/inc/pios_board.h diff --git a/flight/sys/pios_irq.h b/flight/PiOS/STM32F10x/inc/pios_irq.h similarity index 100% rename from flight/sys/pios_irq.h rename to flight/PiOS/STM32F10x/inc/pios_irq.h diff --git a/flight/sys/pios_led.h b/flight/PiOS/STM32F10x/inc/pios_led.h similarity index 100% rename from flight/sys/pios_led.h rename to flight/PiOS/STM32F10x/inc/pios_led.h diff --git a/flight/sys/pios_settings.h b/flight/PiOS/STM32F10x/inc/pios_settings.h similarity index 100% rename from flight/sys/pios_settings.h rename to flight/PiOS/STM32F10x/inc/pios_settings.h diff --git a/flight/sys/pios_sys.h b/flight/PiOS/STM32F10x/inc/pios_sys.h similarity index 100% rename from flight/sys/pios_sys.h rename to flight/PiOS/STM32F10x/inc/pios_sys.h diff --git a/flight/sys/pios_uart.h b/flight/PiOS/STM32F10x/inc/pios_uart.h similarity index 100% rename from flight/sys/pios_uart.h rename to flight/PiOS/STM32F10x/inc/pios_uart.h diff --git a/flight/sys/stm32f10x_conf.h b/flight/PiOS/STM32F10x/inc/stm32f10x_conf.h similarity index 100% rename from flight/sys/stm32f10x_conf.h rename to flight/PiOS/STM32F10x/inc/stm32f10x_conf.h diff --git a/flight/sys/link_stm32f10x_HD.ld b/flight/PiOS/STM32F10x/link_stm32f10x_HD.ld similarity index 100% rename from flight/sys/link_stm32f10x_HD.ld rename to flight/PiOS/STM32F10x/link_stm32f10x_HD.ld diff --git a/flight/sys/pios_irq.c b/flight/PiOS/STM32F10x/pios_irq.c similarity index 100% rename from flight/sys/pios_irq.c rename to flight/PiOS/STM32F10x/pios_irq.c diff --git a/flight/sys/pios_led.c b/flight/PiOS/STM32F10x/pios_led.c similarity index 100% rename from flight/sys/pios_led.c rename to flight/PiOS/STM32F10x/pios_led.c diff --git a/flight/sys/pios_settings.c b/flight/PiOS/STM32F10x/pios_settings.c similarity index 100% rename from flight/sys/pios_settings.c rename to flight/PiOS/STM32F10x/pios_settings.c diff --git a/flight/sys/pios_sys.c b/flight/PiOS/STM32F10x/pios_sys.c similarity index 100% rename from flight/sys/pios_sys.c rename to flight/PiOS/STM32F10x/pios_sys.c diff --git a/flight/sys/pios_uart.c b/flight/PiOS/STM32F10x/pios_uart.c similarity index 100% rename from flight/sys/pios_uart.c rename to flight/PiOS/STM32F10x/pios_uart.c diff --git a/flight/sys/startup_stm32f10x_HD.S b/flight/PiOS/STM32F10x/startup_stm32f10x_HD.S similarity index 100% rename from flight/sys/startup_stm32f10x_HD.S rename to flight/PiOS/STM32F10x/startup_stm32f10x_HD.S diff --git a/flight/sys/pios.c b/flight/PiOS/pios.c similarity index 100% rename from flight/sys/pios.c rename to flight/PiOS/pios.c diff --git a/flight/sys/pios.h b/flight/PiOS/pios.h similarity index 77% rename from flight/sys/pios.h rename to flight/PiOS/pios.h index b35e9f285..13da6b536 100644 --- a/flight/sys/pios.h +++ b/flight/PiOS/pios.h @@ -28,7 +28,6 @@ #ifndef PIOS_H #define PIOS_H - /* C Lib Includes */ #include #include @@ -37,7 +36,7 @@ /* STM32 Std Perf Lib */ #include -#include +#include "STM32F10x/inc/stm32f10x_conf.h" /* FatFS Includes */ #include @@ -46,14 +45,16 @@ /* minIni Includes */ #include -/* PIOS Hardware Includes */ -#include "pios_board.h" -#include "pios_sys.h" -#include "pios_settings.h" -#include "pios_led.h" -#include "pios_uart.h" -#include "pios_irq.h" -#include "pios_com.h" +/* PIOS Hardware Includes (STM32F10x) */ +#include "STM32F10x/inc/pios_board.h" +#include "STM32F10x/inc/pios_sys.h" +#include "STM32F10x/inc/pios_settings.h" +#include "STM32F10x/inc/pios_led.h" +#include "STM32F10x/inc/pios_uart.h" +#include "STM32F10x/inc/pios_irq.h" + +/* PIOS Hardware Includes (Common) */ +#include "Common/inc/pios_com.h" /* More added here as they get written */