Skip to content

Commit

Permalink
Cleanup project structure. Update unit test Makefile to place object
Browse files Browse the repository at this point in the history
files in obj/test
  • Loading branch information
hydra committed May 31, 2014
1 parent fb9e3a2 commit d19a5e7
Show file tree
Hide file tree
Showing 330 changed files with 676 additions and 657 deletions.
108 changes: 54 additions & 54 deletions Makefile
Expand Up @@ -36,18 +36,18 @@ VALID_TARGETS = NAZE OLIMEXINO STM32F3DISCOVERY CHEBUZZF3

# Working directories
ROOT = $(dir $(lastword $(MAKEFILE_LIST)))
SRC_DIR = $(ROOT)/src
OBJECT_DIR = $(ROOT)/obj
BIN_DIR = $(ROOT)/obj
CMSIS_DIR = $(ROOT)/lib/CMSIS
SRC_DIR = $(ROOT)/src/main
OBJECT_DIR = $(ROOT)/obj/main
BIN_DIR = $(ROOT)/obj/main
CMSIS_DIR = $(ROOT)/lib/main/CMSIS
INCLUDE_DIRS = $(SRC_DIR)

# Search path for sources
VPATH := $(SRC_DIR):$(SRC_DIR)/startup

ifeq ($(TARGET),$(filter $(TARGET),STM32F3DISCOVERY CHEBUZZF3))

STDPERIPH_DIR = $(ROOT)/lib/STM32F30x_StdPeriph_Driver
STDPERIPH_DIR = $(ROOT)/lib/main/STM32F30x_StdPeriph_Driver

VPATH := $(VPATH):$(CMSIS_DIR)/CM1/CoreSupport:$(CMSIS_DIR)/CM1/DeviceSupport/ST/STM32F30x
CMSIS_SRC = $(notdir $(wildcard $(CMSIS_DIR)/CM1/CoreSupport/*.c \
Expand All @@ -71,7 +71,7 @@ endif

else

STDPERIPH_DIR = $(ROOT)/lib/STM32F10x_StdPeriph_Driver
STDPERIPH_DIR = $(ROOT)/lib/main/STM32F10x_StdPeriph_Driver

# Search path and source files for the CMSIS sources
VPATH := $(VPATH):$(CMSIS_DIR)/CM3/CoreSupport:$(CMSIS_DIR)/CM3/DeviceSupport/ST/STM32F10x
Expand All @@ -92,49 +92,49 @@ DEVICE_FLAGS = -DSTM32F10X_MD
endif

COMMON_SRC = build_config.c \
battery.c \
boardalignment.c \
buzzer.c \
config.c \
config/config.c \
config/runtime_config.c \
common/maths.c \
common/printf.c \
common/typeconversion.c \
failsafe.c \
main.c \
mw.c \
sensors_acceleration.c \
sensors_barometer.c \
sensors_compass.c \
sensors_gyro.c \
sensors_initialisation.c \
sensors_sonar.c \
flight/autotune.c \
flight/failsafe.c \
flight/flight.c \
flight/imu.c \
flight/mixer.c \
drivers/bus_i2c_soft.c \
drivers/serial_common.c \
drivers/serial.c \
drivers/sound_beeper.c \
drivers/system_common.c \
flight_autotune.c \
flight_common.c \
flight_imu.c \
flight_mixer.c \
gps_common.c \
gps_conversion.c \
runtime_config.c \
rc_controls.c \
rc_curves.c \
rx_common.c \
rx_msp.c \
rx_pwm.c \
rx_sbus.c \
rx_sumd.c \
rx_spektrum.c \
telemetry_common.c \
telemetry_frsky.c \
telemetry_hott.c \
telemetry_msp.c \
serial_common.c \
serial_cli.c \
serial_msp.c \
statusindicator.c \
drivers/system.c \
io/battery.c \
io/buzzer.c \
io/gps.c \
io/gps_conversion.c \
io/rc_controls.c \
io/rc_curves.c \
io/serial.c \
io/serial_cli.c \
io/serial_msp.c \
io/statusindicator.c \
rx/rx.c \
rx/msp.c \
rx/pwm.c \
rx/sbus.c \
rx/sumd.c \
rx/spektrum.c \
sensors/boardalignment.c \
sensors/acceleration.c \
sensors/barometer.c \
sensors/compass.c \
sensors/gyro.c \
sensors/initialisation.c \
sensors/sonar.c \
telemetry/telemetry.c \
telemetry/frsky.c \
telemetry/hott.c \
telemetry/msp.c \
$(CMSIS_SRC) \
$(STDPERIPH_SRC)

Expand All @@ -145,7 +145,7 @@ NAZE_SRC = startup_stm32f10x_md_gcc.S \
drivers/accgyro_mma845x.c \
drivers/accgyro_mpu3050.c \
drivers/accgyro_mpu6050.c \
drivers/adc_common.c \
drivers/adc.c \
drivers/adc_stm32f10x.c \
drivers/barometer_bmp085.c \
drivers/barometer_ms5611.c \
Expand All @@ -159,14 +159,14 @@ NAZE_SRC = startup_stm32f10x_md_gcc.S \
drivers/pwm_output.c \
drivers/pwm_rx.c \
drivers/serial_softserial.c \
drivers/serial_uart_common.c \
drivers/serial_uart.c \
drivers/serial_uart_stm32f10x.c \
drivers/timer_common.c \
drivers/timer.c \
$(COMMON_SRC)

OLIMEXINO_SRC = startup_stm32f10x_md_gcc.S \
drivers/accgyro_mpu6050.c \
drivers/adc_common.c \
drivers/adc.c \
drivers/adc_stm32f10x.c \
drivers/bus_i2c_stm32f10x.c \
drivers/bus_spi.c \
Expand All @@ -176,15 +176,15 @@ OLIMEXINO_SRC = startup_stm32f10x_md_gcc.S \
drivers/pwm_rssi.c \
drivers/pwm_rx.c \
drivers/serial_softserial.c \
drivers/serial_uart_common.c \
drivers/serial_uart.c \
drivers/serial_uart_stm32f10x.c \
drivers/timer_common.c \
drivers/timer.c \
$(COMMON_SRC)

STM32F3DISCOVERY_COMMON_SRC = startup_stm32f30x_md_gcc.S \
STM32F3DISCOVERY_SRC_COMMON = startup_stm32f30x_md_gcc.S \
drivers/accgyro_l3gd20.c \
drivers/accgyro_lsm303dlhc.c \
drivers/adc_common.c \
drivers/adc.c \
drivers/adc_stm32f30x.c \
drivers/bus_i2c_stm32f30x.c \
drivers/bus_spi.c \
Expand All @@ -193,12 +193,12 @@ STM32F3DISCOVERY_COMMON_SRC = startup_stm32f30x_md_gcc.S \
drivers/pwm_output.c \
drivers/pwm_rssi.c \
drivers/pwm_rx.c \
drivers/serial_uart_common.c \
drivers/serial_uart.c \
drivers/serial_uart_stm32f30x.c \
drivers/serial_softserial.c \
drivers/timer_common.c
drivers/timer.c

STM32F3DISCOVERY_SRC = $(STM32F3DISCOVERY_COMMON_SRC) \
STM32F3DISCOVERY_SRC = $(STM32F3DISCOVERY_SRC_COMMON) \
drivers/accgyro_adxl345.c \
drivers/accgyro_bma280.c \
drivers/accgyro_mma845x.c \
Expand All @@ -207,7 +207,7 @@ STM32F3DISCOVERY_SRC = $(STM32F3DISCOVERY_COMMON_SRC) \
drivers/accgyro_l3g4200d.c \
$(COMMON_SRC)

CHEBUZZF3_SRC = $(STM32F3DISCOVERY_COMMON_SRC) \
CHEBUZZF3_SRC = $(STM32F3DISCOVERY_SRC) \
$(COMMON_SRC)

# In some cases, %.s regarded as intermediate file, which is actually not.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/build_config.c → src/main/build_config.c
Expand Up @@ -3,10 +3,10 @@

#include "platform.h"

#include "drivers/gpio_common.h"
#include "drivers/timer_common.h"
#include "drivers/gpio.h"
#include "drivers/timer.h"
#include "drivers/pwm_mapping.h"
#include "flight_mixer.h"
#include "flight/mixer.h"

#include "build_config.h"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/common/printf.c → src/main/common/printf.c
Expand Up @@ -35,8 +35,8 @@
#include <stdlib.h>


#include "drivers/serial_common.h"
#include "serial_common.h"
#include "drivers/serial.h"
#include "io/serial.h"

#include "build_config.h"
#include "printf.h"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
60 changes: 30 additions & 30 deletions src/config.c → src/main/config/config.c
Expand Up @@ -6,36 +6,36 @@
#include "build_config.h"

#include "common/axis.h"
#include "flight_common.h"

#include "drivers/accgyro_common.h"
#include "drivers/system_common.h"

#include "sensors_common.h"
#include "sensors_gyro.h"

#include "statusindicator.h"
#include "sensors_acceleration.h"
#include "sensors_barometer.h"
#include "drivers/serial_common.h"
#include "serial_common.h"
#include "telemetry_common.h"

#include "flight_mixer.h"
#include "boardalignment.h"
#include "battery.h"
#include "gimbal.h"
#include "escservo.h"
#include "rc_controls.h"
#include "rc_curves.h"
#include "rx_common.h"
#include "gps_common.h"
#include "failsafe.h"

#include "runtime_config.h"
#include "config.h"
#include "config_profile.h"
#include "config_master.h"
#include "flight/flight.h"

#include "drivers/accgyro.h"
#include "drivers/system.h"

#include "sensors/sensors.h"
#include "sensors/gyro.h"

#include "io/statusindicator.h"
#include "sensors/acceleration.h"
#include "sensors/barometer.h"
#include "drivers/serial.h"
#include "io/serial.h"
#include "telemetry/telemetry.h"

#include "flight/mixer.h"
#include "sensors/boardalignment.h"
#include "io/battery.h"
#include "io/gimbal.h"
#include "io/escservo.h"
#include "io/rc_controls.h"
#include "io/rc_curves.h"
#include "rx/rx.h"
#include "io/gps.h"
#include "flight/failsafe.h"

#include "config/runtime_config.h"
#include "config/config.h"
#include "config/config_profile.h"
#include "config/config_master.h"


void setPIDController(int type); // FIXME PID code needs to be in flight_pid.c/h
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/runtime_config.c → src/main/config/runtime_config.c
@@ -1,7 +1,7 @@
#include <stdbool.h>
#include <stdint.h>

#include "runtime_config.h"
#include "config/runtime_config.h"

flags_t f;

Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -3,10 +3,10 @@

#include <platform.h>

#include "system_common.h"
#include "system.h"
#include "bus_i2c.h"

#include "accgyro_common.h"
#include "accgyro.h"
#include "accgyro_adxl345.h"

// ADXL345, Alternative address mode 0x53
Expand Down
File renamed without changes.
Expand Up @@ -5,7 +5,7 @@

#include "bus_i2c.h"

#include "accgyro_common.h"
#include "accgyro.h"
#include "accgyro_bma280.h"

// BMA280, default I2C address mode 0x18
Expand Down
File renamed without changes.
Expand Up @@ -3,13 +3,13 @@

#include <platform.h>

#include "system_common.h"
#include "system.h"
#include "bus_i2c.h"

#include "common/maths.h"
#include "common/axis.h"

#include "accgyro_common.h"
#include "accgyro.h"
#include "accgyro_l3g4200d.h"

// L3G4200D, Standard address 0x68
Expand Down
File renamed without changes.
Expand Up @@ -20,11 +20,11 @@

#include "common/maths.h"

#include "system_common.h"
#include "gpio_common.h"
#include "system.h"
#include "gpio.h"
#include "bus_spi.h"

#include "accgyro_common.h"
#include "accgyro.h"
#include "accgyro_l3gd20.h"

extern int16_t debug[4];
Expand Down
File renamed without changes.
Expand Up @@ -6,11 +6,11 @@
#include "common/maths.h"
#include "common/axis.h"

#include "system_common.h"
#include "gpio_common.h"
#include "system.h"
#include "gpio.h"
#include "bus_i2c.h"

#include "accgyro_common.h"
#include "accgyro.h"
#include "accgyro_lsm303dlhc.h"

extern int16_t debug[4];
Expand Down
File renamed without changes.
Expand Up @@ -3,11 +3,11 @@

#include "platform.h"

#include "system_common.h"
#include "gpio_common.h"
#include "system.h"
#include "gpio.h"
#include "bus_i2c.h"

#include "accgyro_common.h"
#include "accgyro.h"
#include "accgyro_mma845x.h"

// MMA8452QT, Standard address 0x1C
Expand Down
File renamed without changes.
Expand Up @@ -5,10 +5,10 @@

#include "common/maths.h"

#include "system_common.h"
#include "system.h"
#include "bus_i2c.h"

#include "accgyro_common.h"
#include "accgyro.h"
#include "accgyro_mpu3050.h"


Expand Down
File renamed without changes.

0 comments on commit d19a5e7

Please sign in to comment.