22 Commits

Author SHA1 Message Date
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
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
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
Daniel Agar
023e267e9b uORB replace ORBMap with linked list 2018-11-23 08:15:48 +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
633102e7ca List and ListNode cleanup 2017-08-20 20:42:42 +02:00
Lorenz Meier
fc745a7afc List.hpp: Fix code style 2015-09-06 12:02:43 +02:00
James Goppert
e1d2c0c5ad Move more messages to auto-generation, work on C++ code style 2015-05-20 08:57:29 +02:00
James Goppert
da9dab2799 Moved List.hpp from controllib to src/include/containers. 2014-03-20 12:12:42 -04:00