Linux to posix conversion

Changed "linux" target to "posix". Most of the changes are shared with
QuRT and with OSX. The Linux specific parts are in for i2c which uses
<linux/i2c.h> and <linux/i2c-dev.h>.

There is also a check for __PX4_LINUX in mavlink for a tty ioctl that is
not supported.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-04-21 09:53:09 -07:00
parent 40faa98416
commit f3b5076d70
109 changed files with 106 additions and 107 deletions
+5 -5
View File
@@ -30,9 +30,9 @@ firmware_nuttx.mk
Called by firmware.mk to build NuttX based firmware.
firmware_linux.mk
firmware_posix.mk
Called by firmware.mk to build Linux (non-ROS) based firmware.
Called by firmware.mk to build POSIX (non-ROS) based firmware.
module.mk
@@ -46,10 +46,10 @@ nuttx.mk
Called by ../Makefile to build or download the NuttX archives if
PX4_TARGET_OS is set to "nuttx".
linux.mk
posix.mk
Called by ../Makefile to set Linux specific parameters if
PX4_TARGET_OS is set to "linux".
Called by ../Makefile to set POSIX specific parameters if
PX4_TARGET_OS is set to "posix".
upload.mk
+2 -2
View File
@@ -360,8 +360,8 @@ $(filter %.S.o,$(OBJS)): $(WORK_DIR)%.S.o: %.S $(GLOBAL_DEPS)
ifeq ($(PX4_TARGET_OS),nuttx)
include $(MK_DIR)/nuttx_romfs.mk
endif
ifeq ($(PX4_TARGET_OS),linux)
include $(MK_DIR)/linux_elf.mk
ifeq ($(PX4_TARGET_OS),posix)
include $(MK_DIR)/posix_elf.mk
endif
ifeq ($(PX4_TARGET_OS),qurt)
include $(MK_DIR)/qurt_elf.mk
+1 -1
View File
@@ -36,5 +36,5 @@
MODULES += \
platforms/common \
platforms/linux/px4_layer
platforms/posix/px4_layer
@@ -1,11 +1,11 @@
#
# Board-specific definitions for the Linux port of PX4
# Board-specific definitions for the POSIX port of PX4
#
#
# Configure the toolchain
#
CONFIG_ARCH = NATIVE
CONFIG_BOARD = LINUXTEST
CONFIG_BOARD = POSIXTEST
include $(PX4_MK_DIR)/toolchain_native.mk
@@ -1,12 +1,7 @@
#
# Makefile for the Foo *default* configuration
# Makefile for the POSIXTEST *default* configuration
#
#
# Use the configuration's ROMFS.
#
#ROMFS_ROOT = $(PX4_BASE)/ROMFS/px4fmu_common
#
# Board support modules
#
@@ -61,17 +56,17 @@ MODULES += lib/conversion
#
# Linux port
#
MODULES += platforms/linux/px4_layer
MODULES += platforms/linux/drivers/accelsim
MODULES += platforms/linux/drivers/gyrosim
MODULES += platforms/linux/drivers/adcsim
MODULES += platforms/linux/drivers/barosim
MODULES += platforms/posix/px4_layer
MODULES += platforms/posix/drivers/accelsim
MODULES += platforms/posix/drivers/gyrosim
MODULES += platforms/posix/drivers/adcsim
MODULES += platforms/posix/drivers/barosim
#
# Unit tests
#
#MODULES += platforms/linux/tests/hello
#MODULES += platforms/linux/tests/vcdev_test
#MODULES += platforms/linux/tests/hrt_test
#MODULES += platforms/linux/tests/wqueue
#MODULES += platforms/posix/tests/hello
#MODULES += platforms/posix/tests/vcdev_test
#MODULES += platforms/posix/tests/hrt_test
#MODULES += platforms/posix/tests/wqueue
@@ -30,7 +30,7 @@
#
#
# Makefile for PX4 Linux based firmware images.
# Makefile for PX4 POSIX based firmware images.
#
################################################################################
@@ -56,9 +56,9 @@ $(PRODUCT_SHARED_PRELINK): $(OBJS) $(MODULE_OBJS) $(LIBRARY_LIBS) $(GLOBAL_DEPS)
$(PRODUCT_SHARED_LIB): $(PRODUCT_SHARED_PRELINK)
$(call LINK_A,$@,$(PRODUCT_SHARED_PRELINK))
MAIN = $(PX4_BASE)/src/platforms/linux/main.cpp
MAIN = $(PX4_BASE)/src/platforms/posix/main.cpp
$(WORK_DIR)mainapp: $(PRODUCT_SHARED_LIB)
$(PX4_BASE)/Tools/linux_apps.py > apps.h
$(PX4_BASE)/Tools/posix_apps.py > apps.h
$(call LINK,$@, -I. $(MAIN) $(PRODUCT_SHARED_LIB))
#
+2 -2
View File
@@ -35,9 +35,9 @@
export PX4_TARGET_OS ?= nuttx
# PX4_TARGET_OS can be nuttx, linux, or qurt
# PX4_TARGET_OS can be nuttx, posix, or qurt
ifeq ($(PX4_TARGET_OS),)
$(error Use: make PX4_TARGET_OS=<target> where <target> is nuttx, linux, or qurt)
$(error Use: make PX4_TARGET_OS=<target> where <target> is nuttx, posix, or qurt)
endif
#
+1 -1
View File
@@ -181,7 +181,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__ \
$(EXTRADEFINES) \
$(EXTRAAFLAGS)
LDSCRIPT = $(PX4_BASE)/linux-configs/linuxtest/scripts/ld.script
LDSCRIPT = $(PX4_BASE)/posix-configs/posixtest/scripts/ld.script
# Flags we pass to the linker
#
LDFLAGS += \
+4 -4
View File
@@ -1,7 +1,7 @@
#
# Copyright (C) 2012-2014 PX4 Development Team. All rights reuint32_tserved.
#
# 2005 Modified for clang and GCC on Linux:
# 2005 Modified for clang and GCC on POSIX:
# Author: Mark Charlebois <charlebm@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
@@ -120,10 +120,10 @@ ifeq ($(CONFIG_BOARD),)
$(error Board config does not define CONFIG_BOARD)
endif
ARCHDEFINES += -DCONFIG_ARCH_BOARD_$(CONFIG_BOARD) \
-D__PX4_LINUX \
-D__PX4_LINUX -D__PX4_POSIX \
-Dnoreturn_function= \
-I$(PX4_BASE)/src/lib/eigen \
-I$(PX4_BASE)/src/platforms/linux/include \
-I$(PX4_BASE)/src/platforms/posix/include \
-Wno-error=shadow
# optimisation flags
@@ -250,7 +250,7 @@ AFLAGS = $(CFLAGS) -D__ASSEMBLY__ \
$(EXTRADEFINES) \
$(EXTRAAFLAGS)
LDSCRIPT = $(PX4_BASE)/linux-configs/linuxtest/scripts/ld.script
LDSCRIPT = $(PX4_BASE)/posix-configs/posixtest/scripts/ld.script
# Flags we pass to the linker
#
LDFLAGS += $(EXTRALDFLAGS) \
+1 -1
View File
@@ -31,7 +31,7 @@ upload-serial-px4fmu-v2: $(BUNDLE) $(UPLOADER)
$(Q) $(PYTHON) -u $(UPLOADER) --port $(SERIAL_PORTS) $(BUNDLE)
upload-serial-aerocore:
openocd -f $(PX4_BASE)/makefiles/gumstix-aerocore.cfg -c 'init; reset halt; flash write_image erase $(PX4_BASE)/../Bootloader/px4aerocore_bl.bin 0x08000000; flash write_image erase $(PX4_BASE)/Build/aerocore_default.build/firmware.bin 0x08004000; reset run; exit'
openocd -f $(PX4_BASE)/makefiles/nuttx/gumstix-aerocore.cfg -c 'init; reset halt; flash write_image erase $(PX4_BASE)/../Bootloader/px4aerocore_bl.bin 0x08000000; flash write_image erase $(PX4_BASE)/Build/aerocore_default.build/firmware.bin 0x08004000; reset run; exit'
upload-serial-px4-stm32f4discovery: $(BUNDLE) $(UPLOADER)
$(Q) $(PYTHON) -u $(UPLOADER) --port $(SERIAL_PORTS) $(BUNDLE)