84 Commits

Author SHA1 Message Date
Daniel Agar
b6a17a6538
new IntrusiveSortedList container used for uORB, WorkQueues, and WorkItems
- new intrusive linked list container (c++ template) that sorts on insertion
 - primarily for convenience inspecting things in the system like uORB or WorkQueues
 - uorb status or top sorted alphabetically 
 - work_queue status threads sorted by priority, then items sorted alphabetically within each
2020-08-04 11:09:41 -04:00
Daniel Agar
d96a841050 List: handle re-inserting
- clear sibling on removal
 - add reinsertion test case to test_list
2020-04-17 11:56:24 -04:00
Beat Küng
1fe79818d9 fix IntrusiveQueue::remove: several bugs that led to improper state of the queue
We also have to set removeNode->next to null, as it is used to test if the
item is in the queue.
2020-03-21 12:00:09 -04:00
Daniel Agar
9585055e9e
uORB: add bitset for faster orb_exists check and remove uORB::Subscription lazy subscribe hack/optimization
- add PX4 bitset and atomic_bitset with testing
 - add uORB::Subscription constructor to take ORB_ID enum
 - move orb test messages into msg/
2020-03-11 09:06:33 -04:00
Daniel Agar
cc7807c066 mixer: update to List<> container 2019-11-22 15:00:25 -05:00
Beat Küng
a203475489 BlockingList: fix unsafe getLockGuard() API
getLockGuard relies on copy elision to work correctly, which the compiler
is not required to do (only with C++17).
If no copy elision happens, the mutex ends up being unlocked twice, and the
CS is executed with the mutex unlocked.

The patch also ensures that the same pattern cannot be used again.
2019-11-05 12:14:20 +01:00
Beat Küng
3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
and remove the px4_ prefix, except for px4_config.h.

command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done

Transitional headers for submodules are added (px4_{defines,log,time}.h)
2019-10-30 11:48:47 +01:00
Daniel Agar
9f4258f6ff clang-tidy: partially fix hicpp-explicit-conversions 2019-10-28 10:50:31 -04:00
Daniel Agar
2f222d6cbf containers/List add nullptr check 2019-08-09 07:55:13 +02:00
Daniel Agar
aee8f13289 List fix remove() and update testing 2019-06-13 10:47:27 -04:00
Daniel Agar
1623de8bd0 IntrusiveQueue add remove method, iterators, and update test 2019-06-13 10:47:27 -04:00
Julian Oes
29915cbc6d BlockingQueue: default initialize _data
This was reported by coverity.
2019-05-29 08:57:46 -04:00
Daniel Agar
e9ca5d5aba PX4 general work queue 2019-05-24 12:58:55 -04:00
Julian Oes
12374490cb visibility.h: clean up includes, add comments
This tries to make the visibility.h header clearer and better
structured. We don't actually need the ifdef for lockstep enabled or
disabled because that's now handled elsewhere.
2019-05-20 12:39:02 -04:00
Julian Oes
84537921e9 visibility.h: fix missing headers 2019-05-20 12:39:02 -04:00
Matthias Grob
f5f95635b4 gtest: fix poisoned exit in compile flags
visibility.h is included globally in PX4 via cmake compile flags.
It contains poisoning the exit() command which is used by gtest
to close the test application. Removing the flag for gtest compilation
fixes the compile error:
gtest.cc:4757:7: error: attempt to use poisoned "exit"
2019-05-09 09:42:46 +02:00
Matthias Grob
63b967f5df Add unit testing possibility using googletest on POSIX 2019-05-09 09:42:46 +02:00
Daniel Agar
edad4c40c3 containers add IntrusiveQueue and testing 2019-03-14 09:22:19 +01:00
Daniel Agar
e2bf4b1894 List container improvements and testing
- support range based for loops
 - add remove() method to remove a node
 - add clear() to empty entire list and delete nodes
 - add empty() helper
2019-03-01 21:01:04 -05:00
Daniel Agar
2ffb49b734 delete px4_includes.h header and update boards/ to use syslog 2019-01-23 18:25:18 -05:00
Daniel Agar
652c9dfc49 containers/Array.hpp cleanup and remove data initialization 2019-01-20 12:03:53 +01:00
Daniel Agar
edeb59a8c3 move logger array.h -> containers/Array.hpp 2019-01-20 12:03:53 +01:00
Julian Oes
547dd8511b platforms: use define for lockstep scheduler
Instead of using the define __PX4_POSIX_SITL it makes more sense to have
a define just to determine if the lockstep scheduler should be used.
2018-12-22 10:32:18 +01:00
Julian Oes
e41518a08b platforms: clean up various build/linking issues
This makes sure lockstep is only built for SITL builds and fixes the
existing builds.
2018-12-22 10:32:18 +01:00
Julian Oes
8cbe26c6f6 platforms: fix linking issues for NuttX build 2018-12-22 10:32:18 +01:00
Julian Oes
d1514cd667 POSIX: add defines system clock calls 2018-12-22 10:32:18 +01:00
Julian Oes
3e6e1f5c2b POSIX: use lockstep_scheduler to fake time
This integrates the lockstep_scheduler, so that the system time is set
by the mavlink HIL_SENSOR message.

This means that the speed factor is removed and the speed is entirely
given by the simulator.
2018-12-22 10:32:18 +01:00
Julian Oes
db6de38b19 Work in progress to support a speed factor in SITL
These contains some rough changes trying to get SITL to speed up by a
SPEED_FACTOR.

This platform time code probably requires some more thought and refactor
but this gets a demo at 4x working.
2018-12-22 10:32:18 +01:00
Julian Oes
d70b0f1c8c Replace sleep with px4_sleep
This is another step to isolate time from the system.
2018-12-22 10:32:18 +01:00
Julian Oes
5b9dea5604 Replacing usleep with px4_usleep
This is a step towards isolating time from the system.
2018-12-22 10:32:18 +01:00
Daniel Agar
023e267e9b uORB replace ORBMap with linked list 2018-11-23 08:15:48 +01:00
Lukas Woodtli
3d29e2e76f Fix some test code related leaks (#10488)
These leaks are not critical but the address-sanitizer complains.
And it's better programming practice anyway.

Signed-off-by: Lukas Woodtli <woodtli.lukas@gmail.com>
2018-09-16 17:38:50 -04:00
Beat Küng
4e6139d9fb Posix: add '#pragma GCC poison exit'
Generally exit() should not be used on Posix, because it exits the whole
program instead of only the task.
2018-08-31 18:11:58 +02:00
Daniel Agar
3ba97297d5 tests simple timing microbenchmark 2018-07-01 09:25:22 +00:00
Daniel Agar
f46ea75c9d mag declinataion test switch to ut_compare_float 2018-03-26 23:16:55 -04:00
Beat Küng
0d26aeafe2 px4_parameter.h: remove this file - it's not used anymore 2018-03-13 17:35:15 +01:00
Daniel Agar
59fd22be1b parameters import/export test 2018-01-30 09:17:56 -05:00
Daniel Agar
545ce9ae24 modules remove extra semicolons 2017-09-16 21:29:52 +01:00
Daniel Agar
08fbd022af lib remove extra semicolons 2017-09-16 21:29:52 +01:00
Daniel Agar
9f44279488 include remove extra semicolons 2017-09-16 21:29:52 +01:00
Daniel Agar
aab91af05b unit_test add missing definition 2017-09-16 21:29:52 +01:00
Daniel Agar
a02caff1bc unit_test inline implementation and remove module build 2017-08-23 08:06:55 +02:00
Daniel Agar
633102e7ca List and ListNode cleanup 2017-08-20 20:42:42 +02:00
Beat Küng
358bcb6ae0 visibility.h: add #pragma GCC poison getenv setenv putenv
Just to make sure that it will never be used on NuttX. This is not an
architectural limitation, just a memory optimization, since we call
clearenv() on NuttX.
2017-03-29 23:02:09 +02:00
Julian Oes
2d4179a35b mavlink: refactor mavlink_log
This moves the mavlink_log interface from ioctl to uORB and enables the
mavlink statusmessage output for Snapdragon. The API changes will lead
to changes in all modules that are using it.
2016-03-24 13:09:16 +01:00
Julian Oes
aa9d698204 mavlink_log: support telem printfs on QURT 2016-03-24 13:08:31 +01:00
Mark Charlebois
d4bb010f47 Whitespace fix
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:44 +01:00
Mark Charlebois
4c9492e10f Rebase changes on upstream master
This brings in many of the changes from the PX4 fork on ATLFLight.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:44 +01:00
Mark Charlebois
d3d231e8b6 Whitespace fix
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:44 +01:00
Mark Charlebois
014f15d8b0 Rebase changes on upstream master
This brings in many of the changes from the PX4 fork on ATLFLight.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:43 +01:00