mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-26 01:17:51 +08:00
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/
This commit is contained in:
@@ -70,6 +70,7 @@ topic_fields = ["%s %s" % (convert_type(field.type), field.name) for field in so
|
||||
#include <px4_platform_common/log.h>
|
||||
#include <px4_platform_common/defines.h>
|
||||
#include <uORB/topics/@(topic_name).h>
|
||||
#include <uORB/topics/uORBTopics.hpp>
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <lib/drivers/device/Device.hpp>
|
||||
|
||||
@@ -78,10 +79,10 @@ topic_fields = ["%s %s" % (convert_type(field.type), field.name) for field in so
|
||||
constexpr char __orb_@(topic_name)_fields[] = "@( ";".join(topic_fields) );";
|
||||
|
||||
@[for multi_topic in topics]@
|
||||
ORB_DEFINE(@multi_topic, struct @uorb_struct, @(struct_size-padding_end_size), __orb_@(topic_name)_fields);
|
||||
ORB_DEFINE(@multi_topic, struct @uorb_struct, @(struct_size-padding_end_size), __orb_@(topic_name)_fields, static_cast<uint8_t>(ORB_ID::@multi_topic));
|
||||
@[end for]
|
||||
|
||||
void print_message(const @uorb_struct& message)
|
||||
void print_message(const @uorb_struct &message)
|
||||
{
|
||||
@[if constrained_flash]
|
||||
(void)message;
|
||||
|
||||
Reference in New Issue
Block a user