The latency_test used to pass an object pointer as argv which
won't work in the posix port because it expects argv to be a
null terminated array of character pointers (which it makes a
copy of).
The test was refactored to use a singleton pattern and avoid
having to pass the object pointer to the thread.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
GCC was more picky about prototypes for inlines being required.
The generate_listener.py script used incorrect printf formats and
was casting %f params to float, but printf casts all %f params to
double per the spec.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The initialization functions were called after the script
commands were run causing a deadlock waiting for an
uninitialized semaphore.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
There were some missed calls to open and ioctl that need to be
px4_open and px4_ioctl.
QuRT also does not provide usleep() so px4_time.h has to be included
in files calling usleep.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The unit test was not passing a null pointer terminated argv.
The posix port depends on argv being null terminated to
determine how may args were passed since PX4 API doesn't
pass argc when spawning a new task.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
uORB was refactored in order to support the MuORB changes required
for QURT. Those changes wil be added in a subsequent commit.
The files are split out by posix and nuttx so the changes are visible.
When this has been tested, the files can be re-merged and re-tested.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The HRT call processing normally happens via HW timer interrupt
handler. Since the POSIX port has no ISR handling, the HP work
queue is used.
Instead of irq_save() and irq_restore() calls to disable/enable
interrupts, a mutex is used to protect each queue.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
In STM32, the ISR handler calls hrt_call_invoke(). There is no
interrupt timer inthe POSIX port so a work item is put on the
high priority work queue to expire at the next event (in ticks)
or at the next max delay interval.
Counter wrapping is likely still not handled properly in this code.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The debug message made it difficult to use the shell for the
posix build. Commented out the debug line.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Sensor combined topic notification wasnot working because
the calls to hrt_called() and hrt_call_after() in
ORBDevNode::appears_updated() are not working correctly.
This commit ifdefs out those calls, and the poling seems
to work correctly. This is a workaround until the issue is
resolved.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Simulator can work as before with -s flag or with Roman's additions to
publish the sensors combined topic using -p flag.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The commented out lock and unlock were determined to be needed and added back.
The unit test for VDev was updated. It showed the race between the poll and a
write that only does a poll_notify().
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Clang build fails due to -Werr and warning on use of
if (!condition != other_condition && some_condition)
Clang wants to be clear that the initial '!' wasn't
intended for the whole expression.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
MuORB was missing the orb_exists() function added to uORB.cpp
gyro_calibration.cpp still had some merge conflicts that had not been resolved.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Fixed print format for __LINE__ to %d
Fixed if/else that breaks with the debug macro expansion. The if/else
needs to use braces to allow macro expansion.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
sim.cpp was causing the posix shell to have continuous debug output.
Used debug macros to suppress output
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Created px4_debug,h to define:
PX4_DBG
PX4_INFO
PX4_WARN
PX4_ERR
These enable OS specific mappings to be made, filtering, etc.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Added simulated tone_alarm class and enabled led class for posix build.
The simulator implements the led_init, led_on, led_off, led_toggle calls.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>