mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
Merge branch 'corvuscorax/OP-1298_metadata_fix' into next
This commit is contained in:
commit
c6b5011cec
@ -79,7 +79,6 @@ int32_t $(NAME)Initialize(void)
|
|||||||
void $(NAME)SetDefaults(UAVObjHandle obj, uint16_t instId)
|
void $(NAME)SetDefaults(UAVObjHandle obj, uint16_t instId)
|
||||||
{
|
{
|
||||||
$(NAME)Data data;
|
$(NAME)Data data;
|
||||||
UAVObjMetadata metadata;
|
|
||||||
|
|
||||||
// Initialize object fields to their default values
|
// Initialize object fields to their default values
|
||||||
UAVObjGetInstanceData(obj, instId, &data);
|
UAVObjGetInstanceData(obj, instId, &data);
|
||||||
@ -88,18 +87,21 @@ $(INITFIELDS)
|
|||||||
UAVObjSetInstanceData(obj, instId, &data);
|
UAVObjSetInstanceData(obj, instId, &data);
|
||||||
|
|
||||||
// Initialize object metadata to their default values
|
// Initialize object metadata to their default values
|
||||||
metadata.flags =
|
if ( instId == 0 ) {
|
||||||
$(FLIGHTACCESS) << UAVOBJ_ACCESS_SHIFT |
|
UAVObjMetadata metadata;
|
||||||
$(GCSACCESS) << UAVOBJ_GCS_ACCESS_SHIFT |
|
metadata.flags =
|
||||||
$(FLIGHTTELEM_ACKED) << UAVOBJ_TELEMETRY_ACKED_SHIFT |
|
$(FLIGHTACCESS) << UAVOBJ_ACCESS_SHIFT |
|
||||||
$(GCSTELEM_ACKED) << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
|
$(GCSACCESS) << UAVOBJ_GCS_ACCESS_SHIFT |
|
||||||
$(FLIGHTTELEM_UPDATEMODE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
|
$(FLIGHTTELEM_ACKED) << UAVOBJ_TELEMETRY_ACKED_SHIFT |
|
||||||
$(GCSTELEM_UPDATEMODE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT |
|
$(GCSTELEM_ACKED) << UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT |
|
||||||
$(LOGGING_UPDATEMODE) << UAVOBJ_LOGGING_UPDATE_MODE_SHIFT;
|
$(FLIGHTTELEM_UPDATEMODE) << UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT |
|
||||||
metadata.telemetryUpdatePeriod = $(FLIGHTTELEM_UPDATEPERIOD);
|
$(GCSTELEM_UPDATEMODE) << UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT |
|
||||||
metadata.gcsTelemetryUpdatePeriod = $(GCSTELEM_UPDATEPERIOD);
|
$(LOGGING_UPDATEMODE) << UAVOBJ_LOGGING_UPDATE_MODE_SHIFT;
|
||||||
metadata.loggingUpdatePeriod = $(LOGGING_UPDATEPERIOD);
|
metadata.telemetryUpdatePeriod = $(FLIGHTTELEM_UPDATEPERIOD);
|
||||||
UAVObjSetMetadata(obj, &metadata);
|
metadata.gcsTelemetryUpdatePeriod = $(GCSTELEM_UPDATEPERIOD);
|
||||||
|
metadata.loggingUpdatePeriod = $(LOGGING_UPDATEPERIOD);
|
||||||
|
UAVObjSetMetadata(obj, &metadata);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,14 +22,12 @@
|
|||||||
#include "sdlgamepad.h"
|
#include "sdlgamepad.h"
|
||||||
|
|
||||||
#include <SDL/SDL.h>
|
#include <SDL/SDL.h>
|
||||||
//#undef main
|
// #undef main
|
||||||
|
|
||||||
class SDLGamepadPrivate
|
class SDLGamepadPrivate {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
SDLGamepadPrivate() : gamepad(0)
|
SDLGamepadPrivate() : gamepad(0)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SDL_Joystick object.
|
* SDL_Joystick object.
|
||||||
@ -37,7 +35,6 @@ public:
|
|||||||
* This represents the currently opened SDL_Joystick object.
|
* This represents the currently opened SDL_Joystick object.
|
||||||
*/
|
*/
|
||||||
SDL_Joystick *gamepad;
|
SDL_Joystick *gamepad;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
@ -48,7 +45,7 @@ SDLGamepad::SDLGamepad()
|
|||||||
index = -1;
|
index = -1;
|
||||||
loop = false;
|
loop = false;
|
||||||
tick = MIN_RATE;
|
tick = MIN_RATE;
|
||||||
priv = new SDLGamepadPrivate;
|
priv = new SDLGamepadPrivate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user