mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 09:03:34 +08:00
Use union of datatypes supported by dataman to reduce wasted space
This commit is contained in:
committed by
Lorenz Meier
parent
b1e94b98b3
commit
b2bf9e15eb
@@ -42,6 +42,7 @@
|
||||
#include <navigator/navigation.h>
|
||||
#include <uORB/topics/mission.h>
|
||||
#include <uORB/topics/fence.h>
|
||||
#include <uORB/topics/fence_vertex.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -102,8 +103,18 @@ typedef enum {
|
||||
DM_INIT_REASON_VOLATILE /* Data does not survive reset */
|
||||
} dm_reset_reason;
|
||||
|
||||
/** Maximum size in bytes of a single item instance */
|
||||
#define DM_MAX_DATA_SIZE 126
|
||||
/** Maximum size in bytes of a single item instance is
|
||||
* defined by adding the structure type to the union below
|
||||
*/
|
||||
|
||||
typedef union dataman_max_size_t {
|
||||
struct mission_item_s mission_item;
|
||||
struct mission_s mission;
|
||||
struct fence_vertex_s vertex;
|
||||
} dataman_max_size_t;
|
||||
|
||||
|
||||
#define DM_MAX_DATA_SIZE sizeof(dataman_max_size_t)
|
||||
|
||||
/** Retrieve from the data manager store */
|
||||
__EXPORT ssize_t
|
||||
|
||||
Reference in New Issue
Block a user