From f143628e80c9fbc33d3a5c3587019cfd5f568c62 Mon Sep 17 00:00:00 2001 From: vassilis Date: Thu, 20 May 2010 01:21:44 +0000 Subject: [PATCH] Flight/Altitude Update altitude object with new metafields, modified update rates in XML and flight s/w git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@645 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/OpenPilot/Modules/Altitude/altitude.c | 6 ++---- flight/OpenPilot/UAVObjects/altitudeactual.c | 10 ++++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/flight/OpenPilot/Modules/Altitude/altitude.c b/flight/OpenPilot/Modules/Altitude/altitude.c index 6e9b7c878..222a03fd2 100644 --- a/flight/OpenPilot/Modules/Altitude/altitude.c +++ b/flight/OpenPilot/Modules/Altitude/altitude.c @@ -37,6 +37,7 @@ // Private constants #define STACK_SIZE configMINIMAL_STACK_SIZE #define TASK_PRIORITY (tskIDLE_PRIORITY+3) +#define UPDATE_PERIOD 100 // Private types @@ -72,9 +73,6 @@ static void altitudeTask(void* parameters) lastSysTime = xTaskGetTickCount(); while (1) { - // Get the object data - AltitudeActualGet(&data); - // Update the temperature data PIOS_BMP085_StartADC(TemperatureConv); #if 0 @@ -104,6 +102,6 @@ static void altitudeTask(void* parameters) AltitudeActualSet(&data); // Delay until it is time to read the next sample - vTaskDelayUntil(&lastSysTime, 1000 / portTICK_RATE_MS ); + vTaskDelayUntil(&lastSysTime, UPDATE_PERIOD / portTICK_RATE_MS ); } } diff --git a/flight/OpenPilot/UAVObjects/altitudeactual.c b/flight/OpenPilot/UAVObjects/altitudeactual.c index 43e9e93b7..d7b2529d9 100644 --- a/flight/OpenPilot/UAVObjects/altitudeactual.c +++ b/flight/OpenPilot/UAVObjects/altitudeactual.c @@ -77,12 +77,14 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId) UAVObjSetInstanceData(obj, instId, &data); // Initialize object metadata to their default values + metadata.access = ACCESS_READWRITE; + metadata.gcsAccess = ACCESS_READWRITE; metadata.telemetryAcked = 1; - metadata.telemetryUpdateMode = UPDATEMODE_ONCHANGE; - metadata.telemetryUpdatePeriod = 0; + metadata.telemetryUpdateMode = UPDATEMODE_PERIODIC; + metadata.telemetryUpdatePeriod = 1000; metadata.gcsTelemetryAcked = 1; - metadata.gcsTelemetryUpdateMode = UPDATEMODE_PERIODIC; - metadata.gcsTelemetryUpdatePeriod = 200; + metadata.gcsTelemetryUpdateMode = UPDATEMODE_MANUAL; + metadata.gcsTelemetryUpdatePeriod = 0; metadata.loggingUpdateMode = UPDATEMODE_NEVER; metadata.loggingUpdatePeriod = 0; UAVObjSetMetadata(obj, &metadata);