The variable MAVLINK_SRC was defined and then redefined.
Commented out the first definition and moved beside that overriding
definition for visibility.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
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>
Now run:
make PX4_TARGET_OS=nuttx
or
make PX4_TARGET_OS=linux
To test the linux build and make sure that the required directories
exist, run:
make linuxrun
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Modified uint32_t casts of pointers to unsigned long for portability.
It otherwise breaks on x86_64.
Added _PX4_IOC to handle the conflice between _IOC on Linux and NuttX.
Removed use of px4::ok() because it cannot be used in a thread based
implementation. Changed to use px4::AppMgr which uses ok() on ROS.
Removed up_cxxinitialize.c from Linux build.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Uncomment the following line in setup.mk and comment out the line above
to enable the Linux build.
export PX4_TARGET_OS = linux
The build uses the clang compiler by default. The final bundled executable
is mainapp located in:
Build/linux_default.build/mainapp
When you run mainapp it will provide a list of the built-in apps. You can
type in the commands to run such as:
hello_main start
Because the Linux build is threaded and does not support tasks or processes,
it cannot call errx, exit() _exit(), etc. It also requires unique scoped
variables to test if a thread is running or if an application should exit.
The px4::AppMgr class was added in px4_app.h for this purpose. The
hello sample app demonstrates how this is used.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Moved the NuttX specific board files to makefiles/nuttx and added
a makfiles/linux directory with sample config and board files.
Created a makefiles/toolchain_native.mk file for building for Linux
with the native system compiler. GCC or clang can be used by setting
a flag in the file.
The Linux build creates an archive file and will build the tasks as
threads. Other code changes are required to support both task based
and thread based builds.
The NuttX source should not be required for the Linux build. The
target OS (NuttX or Linux) is selected by commenting out the desired
line in setup.mk
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
If there is an IO firmware image already built when we build the corresponding FMU ROMFS, copy it into the ROMFS. Note - due to there being no fixed build ordering, to be certain that you have the most current IO firmware, you must build the IO firmware explicitly first.