Skip to content

Commit

Permalink
Merge pull request #248 from rosflight/feature_188
Browse files Browse the repository at this point in the history
Abstract comm link layer
  • Loading branch information
superjax authored Nov 28, 2017
2 parents a730f82 + 6f60b1a commit ccd34b0
Show file tree
Hide file tree
Showing 26 changed files with 1,491 additions and 751 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[submodule "lib/mavlink/v1.0"]
path = lib/mavlink/v1.0
path = comms/mavlink/v1.0
url = https://github.com/rosflight/mavlink_c_library.git
[submodule "boards/naze/lib/breezystm32"]
path = boards/naze/lib/breezystm32
Expand Down
12 changes: 9 additions & 3 deletions boards/naze/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

TARGET ?= rosflight

DEBUG ?= GDB
DEBUG ?=

SERIAL_DEVICE ?= /dev/ttyUSB0

Expand All @@ -52,6 +52,7 @@ A2L=arm-none-eabi-addr2line
ROOT = $(dir $(lastword $(MAKEFILE_LIST)))
BOARD_DIR = .
ROSFLIGHT_DIR = ../..
MAVLINK_DIR = $(ROSFLIGHT_DIR)/comms/mavlink
TURBOMATH_DIR = $(ROSFLIGHT_DIR)/lib/turbomath
BREEZY_DIR = lib/breezystm32
CMSIS_DIR = $(BREEZY_DIR)/lib/CMSIS
Expand All @@ -70,15 +71,19 @@ BOARD_C_SRC = flash.c
BOARD_CXX_SRC = naze32.cpp \
main.cpp

# MAVLink source files
VPATH := $(MAVLINK_DIR)
MAVLINK_SRC = mavlink.cpp

# ROSflight source files
VPATH := $(VPATH):$(ROSFLIGHT_DIR)
ROSFLIGHT_SRC = rosflight.cpp \
param.cpp \
sensors.cpp \
state_manager.cpp \
estimator.cpp \
mavlink.cpp \
controller.cpp \
comm_manager.cpp \
command_manager.cpp \
rc.cpp \
mixer.cpp
Expand Down Expand Up @@ -133,6 +138,7 @@ CXXSOURCES = $(addprefix $(ROSFLIGHT_DIR)/src/, $(ROSFLIGHT_SRC)) \
# Set up Include Directoreis
INCLUDE_DIRS = $(BREEZY_DIR) \
$(ROSFLIGHT_DIR)/include \
$(MAVLINK_DIR) \
$(ROSFLIGHT_DIR)/lib \
$(STDPERIPH_DIR)/inc \
$(CMSIS_DIR)/CM3/CoreSupport \
Expand Down Expand Up @@ -187,7 +193,7 @@ GIT_VARS := -DGIT_VERSION_HASH=0x$(GIT_VERSION_HASH) -DGIT_VERSION_STRING=\"$(GI
#################################
CXX_STRICT_FLAGS += -std=c++11 -pedantic -pedantic-errors -Werror -Wall -Wextra \
-Wcast-align -Wcast-qual -Wdisabled-optimization -Wformat=2 -Wlogical-op -Wmissing-include-dirs \
-Wredundant-decls -Wshadow -Wstrict-overflow=5 -Wswitch-default -Wundef -Wunused -Wvariadic-macros \
-Wredundant-decls -Wshadow -Wstrict-overflow=5 -Wundef -Wunused -Wvariadic-macros \
-Wctor-dtor-privacy -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wsign-promo -Wstrict-null-sentinel
FILE_SIZE_FLAGS += -ffunction-sections -fdata-sections -fno-exceptions
CXX_FILE_SIZE_FLAGS = $(C_FILE_SIZE_FLAGS) -fno-rtti
Expand Down
2 changes: 1 addition & 1 deletion boards/naze/lib/breezystm32
5 changes: 3 additions & 2 deletions boards/naze/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@

#include "naze32.h"
#include "rosflight.h"
//#include "mavlink.h"
#include "mavlink.h"

int main(void)
{
rosflight_firmware::Naze32 board;
rosflight_firmware::ROSflight firmware(board);
rosflight_firmware::Mavlink mavlink(board);
rosflight_firmware::ROSflight firmware(board, mavlink);

firmware.init();

Expand Down
Loading

0 comments on commit ccd34b0

Please sign in to comment.