From 2bf40efe8bb86f18ca68033d3658fb9f144c5014 Mon Sep 17 00:00:00 2001
From: Julian Oes <julian@oes.ch>
Date: Thu, 14 Jul 2016 13:55:21 +0200
Subject: [PATCH] RPi2: fuse mainapp/common and navio2

We currently only support Navio2, so let's fuse the two configurations.
---
 Makefile                                 |   3 -
 cmake/configs/posix_navio2_release.cmake | 114 -----------------------
 cmake/configs/posix_rpi2_common.cmake    |   3 +
 posix-configs/rpi2/mainapp.config        |   8 +-
 posix-configs/rpi2/navio2.config         |  24 -----
 5 files changed, 10 insertions(+), 142 deletions(-)
 delete mode 100644 cmake/configs/posix_navio2_release.cmake
 delete mode 100644 posix-configs/rpi2/navio2.config

diff --git a/Makefile b/Makefile
index 8271d7c3c8..4d7529b61c 100644
--- a/Makefile
+++ b/Makefile
@@ -221,9 +221,6 @@ posix_rpi2_cross:
 posix_bebop_default:
 	$(call cmake-build,$@)
 
-posix_navio2_release:
-	$(call cmake-build,$@)
-
 posix: posix_sitl_default
 
 broadcast: posix_sitl_broadcast
diff --git a/cmake/configs/posix_navio2_release.cmake b/cmake/configs/posix_navio2_release.cmake
deleted file mode 100644
index 402b74dba8..0000000000
--- a/cmake/configs/posix_navio2_release.cmake
+++ /dev/null
@@ -1,114 +0,0 @@
-include(posix/px4_impl_posix)
-
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linux-gnueabihf-raspbian.cmake)
-
-set(CMAKE_PROGRAM_PATH
-	"${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/bin"
-	${CMAKE_PROGRAM_PATH}
-)
-
-# This definition allows to differentiate if this just the usual POSIX build
-# or if it is for the RPi.
-add_definitions(
-	-D__PX4_POSIX_RPI2
-	-D__LINUX
-)
-
-set(config_module_list
-	#
-	# Board support modules
-	#
-	drivers/device
-	modules/sensors
-	platforms/posix/drivers/df_mpu9250_wrapper
-	platforms/posix/drivers/df_lsm9ds1_wrapper
-	platforms/posix/drivers/df_ms5611_wrapper
-	platforms/posix/drivers/df_hmc5883_wrapper
-	platforms/posix/drivers/df_trone_wrapper
-	platforms/posix/drivers/df_isl29501_wrapper
-
-	#
-	# System commands
-	#
-	systemcmds/param
-	systemcmds/mixer
-	systemcmds/ver
-	systemcmds/esc_calib
-	systemcmds/topic_listener
-	systemcmds/perf
-
-	#
-	# Estimation modules (EKF/ SO3 / other filters)
-	#
-	#modules/attitude_estimator_ekf
-	modules/ekf_att_pos_estimator
-	modules/attitude_estimator_q
-	modules/position_estimator_inav
-	modules/local_position_estimator
-	modules/ekf2
-
-	#
-	# Vehicle Control
-	#
-	modules/mc_att_control
-	modules/mc_pos_control
-	modules/fw_att_control
-	modules/fw_pos_control_l1	
-	modules/vtol_att_control
-
-	#
-	# Library modules
-	#
-	modules/sdlog2
-	modules/logger
-	modules/commander
-	modules/load_mon
-	modules/param
-	modules/systemlib
-	modules/systemlib/mixer
-	modules/uORB
-	modules/dataman
-	modules/land_detector
-	modules/navigator
-	modules/mavlink
-
-	#
-	# PX4 drivers
-	#
-	drivers/gps
-	drivers/navio_sysfs_rc_in
-	drivers/navio_sysfs_pwm_out
-
-	#
-	# Libraries
-	#
-	lib/controllib
-	lib/mathlib
-	lib/mathlib/math/filter
-	lib/geo
-	lib/ecl
-	lib/geo_lookup
-	lib/launchdetection
-	lib/external_lgpl
-	lib/conversion
-	lib/terrain_estimation
-	lib/runway_takeoff
-	lib/tailsitter_recovery
-	lib/DriverFramework/framework
-
-	#
-	# POSIX
-	#
-	platforms/common
-	platforms/posix/px4_layer
-	platforms/posix/work_queue
-)
-
-set(config_df_driver_list
-	mpu9250
-	lsm9ds1
-	ms5611
-	hmc5883
-	trone
-	isl29501
-)
diff --git a/cmake/configs/posix_rpi2_common.cmake b/cmake/configs/posix_rpi2_common.cmake
index 68479eaf9a..b6437879a8 100644
--- a/cmake/configs/posix_rpi2_common.cmake
+++ b/cmake/configs/posix_rpi2_common.cmake
@@ -73,6 +73,9 @@ set(config_module_list
 	#
 	# PX4 drivers
 	#
+	drivers/gps
+	drivers/navio_sysfs_rc_in
+	drivers/navio_sysfs_pwm_out
 
 	#
 	# Libraries
diff --git a/posix-configs/rpi2/mainapp.config b/posix-configs/rpi2/mainapp.config
index 752ea8f66b..003fb52c44 100644
--- a/posix-configs/rpi2/mainapp.config
+++ b/posix-configs/rpi2/mainapp.config
@@ -7,6 +7,7 @@ df_lsm9ds1_wrapper start -R 4
 #df_mpu9250_wrapper start -R 10
 #df_hmc5883_wrapper start
 df_ms5611_wrapper start
+gps start -d /dev/pts/0
 sensors start
 commander start
 attitude_estimator_q start
@@ -18,4 +19,9 @@ mavlink start -u 14556 -r 1000000
 sleep 1
 mavlink stream -u 14556 -s HIGHRES_IMU -r 50
 mavlink stream -u 14556 -s ATTITUDE -r 50
-mavlink boot_complete
+mavlink start -d /dev/ttyUSB0
+mavlink stream -d /dev/ttyUSB0 -s HIGHRES_IMU -r 50
+mavlink stream -d /dev/ttyUSB0 -s ATTITUDE -r 50
+navio_sysfs_rc_in start
+navio_sysfs_pwm_out start
+mavlink boot_complete
\ No newline at end of file
diff --git a/posix-configs/rpi2/navio2.config b/posix-configs/rpi2/navio2.config
deleted file mode 100644
index 74de109c57..0000000000
--- a/posix-configs/rpi2/navio2.config
+++ /dev/null
@@ -1,24 +0,0 @@
-uorb start
-param set SYS_AUTOSTART 4001
-param set MAV_BROADCAST 1
-sleep 1
-param set MAV_TYPE 2
-df_lsm9ds1_wrapper start -R 4
-#df_mpu9250_wrapper start -R 10
-#df_hmc5883_wrapper start
-df_ms5611_wrapper start
-gps start -d /dev/pts/0
-sensors start
-commander start
-attitude_estimator_q start
-position_estimator_inav start
-land_detector start multicopter
-mc_pos_control start
-mc_att_control start
-mavlink start -d /dev/ttyUSB0
-sleep 1
-mavlink stream -d /dev/ttyUSB0 -s HIGHRES_IMU -r 50
-mavlink stream -d /dev/ttyUSB0 -s ATTITUDE -r 50
-mavlink boot_complete
-navio_sysfs_rc_in start
-navio_sysfs_pwm_out start
-- 
GitLab