The calls to orb_advertise were being mishandled throughout the code.
There were ::close() calls on memory pointers, there were checks
against < 0 when it is a pointer to a object and values larger than
0x7ffffffff are valid. Some places orb_advert_t variables were
being initialized as 0 other places as -1.
The orb_advert_t type was changed to uintptr_t so the pointer value
would not be wrapped as a negative number. This was causing a failure
on ARM.
Tests for < 0 were changed to == 0 since a null pointer is the valid
representation for error, or uninitialized.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Using %llu or %lu will break one of the build targets. The "right way"
to print a uint64_t is via the PRIU64 macro defined in C99.
This wasn't defined for the NuttX compiler so it was added to px4_defines.h
for NuttX.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The ROS build included some files that used isfinite vs PX4_ISFINITE.
The AppState class also needed to be supported for ROS.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
In the upstream tree ringbuffer.h includes the method implementations
in the header file which causes multiple definitions in the link for
other targets. Changed so ringbuffer.cpp is build separately for other
platforms and is included by ringbuffer.h on NuttX.
uORB changes do not link without uORBTest_UnitTest.cpp enabled for
the NuttX build.
px4_getopt was not exported and wasn't visible in NuttX build.
The makefiles were restored to be as close as possible to upstream
so the NuttX build builtin's work again. The code will have to be
refactored after the merge.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The calls to task_spawn_cmd, kill_all, and systemreset were wrappers
around the px4_{task_spawn_cmd|kill_all|systemreset} implementations.
Removed the wrappers and changed all calls to the px4_ equivalents.
NuttX specific code was moved into px4_tasks.h
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>
Keep existing API use in code. Bind the use of the OS independent
implementation in the systemlib layer.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Calls to task_delete and task_spawn_cmd are now
px4_task_delete and px4_task_spawn_cmd respectively.
The px4_tasks.h header was added to the affected files
and incusions of nuttx/config.h were removed.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>