Skip to content
Snippets Groups Projects
Commit f3b5076d authored by Mark Charlebois's avatar Mark Charlebois
Browse files

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: default avatarMark Charlebois <charlebm@gmail.com>
parent 40faa984
No related branches found
No related tags found
No related merge requests found
Showing
with 35 additions and 40 deletions
......@@ -100,8 +100,8 @@ endif
ifeq ($(PX4_TARGET_OS),nuttx)
include $(PX4_BASE)makefiles/firmware_nuttx.mk
endif
ifeq ($(PX4_TARGET_OS),linux)
include $(PX4_BASE)makefiles/firmware_linux.mk
ifeq ($(PX4_TARGET_OS),posix)
include $(PX4_BASE)makefiles/firmware_posix.mk
endif
ifeq ($(PX4_TARGET_OS),qurt)
include $(PX4_BASE)makefiles/firmware_qurt.mk
......@@ -146,8 +146,8 @@ testbuild:
$(Q) (cd $(PX4_BASE) && $(MAKE) distclean && $(MAKE) archives && $(MAKE) -j8)
$(Q) (zip -r Firmware.zip $(PX4_BASE)/Images)
linuxrun:
Tools/linux_run.sh
posixrun:
Tools/posix_run.sh
#
# Unittest targets. Builds and runs the host-level
......
File moved
File moved
......@@ -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
......
......@@ -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
......
File moved
......@@ -36,5 +36,5 @@
MODULES += \
platforms/common \
platforms/linux/px4_layer
platforms/posix/px4_layer
#
# 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
#
# 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))
#
......
......@@ -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
#
......
......@@ -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 += \
......
#
# 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) \
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment