mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
OP-54: Flight/UAVObjects updated templates for enum field types
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@418 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
47ac2d4528
commit
b51c29c2f9
@ -50,10 +50,10 @@ int32_t ExampleObjectInitialize()
|
||||
// Initialize metadata
|
||||
metadata.telemetryAcked = 1;
|
||||
metadata.telemetryUpdateMode = UPDATEMODE_ONCHANGE;
|
||||
metadata.telemetryUpdatePeriod = 0;
|
||||
metadata.telemetryUpdatePeriod = 100;
|
||||
metadata.gcsTelemetryAcked = 1;
|
||||
metadata.gcsTelemetryUpdateMode = UPDATEMODE_PERIODIC;
|
||||
metadata.gcsTelemetryUpdatePeriod = 100;
|
||||
metadata.gcsTelemetryUpdateMode = UPDATEMODE_ONCHANGE;
|
||||
metadata.gcsTelemetryUpdatePeriod = 0;
|
||||
metadata.loggingUpdateMode = UPDATEMODE_NEVER;
|
||||
metadata.loggingUpdatePeriod = 0;
|
||||
UAVObjSetMetadata(handle, &metadata);
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "openpilot.h"
|
||||
|
||||
// Object constants
|
||||
#define EXAMPLEOBJECT_OBJID 3048370380U
|
||||
#define EXAMPLEOBJECT_OBJID 1785231914U
|
||||
#define EXAMPLEOBJECT_NAME "ExampleObject"
|
||||
#define EXAMPLEOBJECT_ISSINGLEINST 0
|
||||
#define EXAMPLEOBJECT_ISSETTINGS 0
|
||||
@ -49,11 +49,19 @@
|
||||
typedef struct {
|
||||
int8_t field1;
|
||||
int16_t field2;
|
||||
float field3[4];
|
||||
int32_t field4;
|
||||
int32_t field3;
|
||||
float field4[4];
|
||||
uint8_t field5;
|
||||
uint16_t field6;
|
||||
uint32_t field7;
|
||||
uint8_t field8;
|
||||
|
||||
} __attribute__((packed)) ExampleObjectData;
|
||||
|
||||
// Enumeration types
|
||||
typedef enum { EXAMPLEOBJECT_FIELD8_OPTION1=0, EXAMPLEOBJECT_FIELD8_OPTION2=1, } EXAMPLEOBJECTFIELD8Enum;
|
||||
|
||||
|
||||
// Generic interface functions
|
||||
int32_t ExampleObjectInitialize();
|
||||
UAVObjHandle ExampleObjectGetHandle();
|
||||
|
@ -54,6 +54,9 @@ typedef struct {
|
||||
|
||||
} __attribute__((packed)) ExampleSettingsData;
|
||||
|
||||
// Enumeration types
|
||||
|
||||
|
||||
// Generic interface functions
|
||||
int32_t ExampleSettingsInitialize();
|
||||
UAVObjHandle ExampleSettingsGetHandle();
|
||||
|
@ -50,6 +50,9 @@ typedef struct {
|
||||
$(DATAFIELDS)
|
||||
} __attribute__((packed)) $(NAME)Data;
|
||||
|
||||
// Enumeration types
|
||||
$(DATAENUM)
|
||||
|
||||
// Generic interface functions
|
||||
int32_t $(NAME)Initialize();
|
||||
UAVObjHandle $(NAME)GetHandle();
|
||||
|
Loading…
x
Reference in New Issue
Block a user