1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-16 08:29:15 +01:00

LP-182 Add empty line before #ifdef and after #endif

This commit is contained in:
Laurent Lalanne 2015-11-14 14:27:12 +01:00
parent 705bd2a483
commit 2295208abe

View File

@ -100,29 +100,34 @@
#ifdef PIOS_INCLUDE_RFM22B #ifdef PIOS_INCLUDE_RFM22B
#define HAS_RADIO #define HAS_RADIO
#endif #endif
// Private types // Private types
typedef struct { typedef struct {
// Determine port on which to communicate telemetry information // Determine port on which to communicate telemetry information
uint32_t (*getPort)(); uint32_t (*getPort)();
// Main telemetry queue // Main telemetry queue
xQueueHandle queue; xQueueHandle queue;
#ifdef PIOS_TELEM_PRIORITY_QUEUE #ifdef PIOS_TELEM_PRIORITY_QUEUE
// Priority telemetry queue // Priority telemetry queue
xQueueHandle priorityQueue; xQueueHandle priorityQueue;
#endif /* PIOS_TELEM_PRIORITY_QUEUE */ #endif /* PIOS_TELEM_PRIORITY_QUEUE */
// Transmit/receive task handles // Transmit/receive task handles
xTaskHandle txTaskHandle; xTaskHandle txTaskHandle;
xTaskHandle rxTaskHandle; xTaskHandle rxTaskHandle;
// Telemetry stream // Telemetry stream
UAVTalkConnection uavTalkCon; UAVTalkConnection uavTalkCon;
} channelContext; } channelContext;
#ifdef HAS_RADIO #ifdef HAS_RADIO
// Main telemetry channel // Main telemetry channel
static channelContext localChannel; static channelContext localChannel;
static int32_t transmitLocalData(uint8_t *data, int32_t length); static int32_t transmitLocalData(uint8_t *data, int32_t length);
static void registerLocalObject(UAVObjHandle obj); static void registerLocalObject(UAVObjHandle obj);
static uint32_t localPort(); static uint32_t localPort();
#endif #endif /* ifdef HAS_RADIO */
static void updateSettings(channelContext *channel); static void updateSettings(channelContext *channel);
// OPLink telemetry channel // OPLink telemetry channel
@ -165,6 +170,7 @@ static void gcsTelemetryStatsUpdated();
*/ */
int32_t TelemetryStart(void) int32_t TelemetryStart(void)
{ {
#ifdef HAS_RADIO #ifdef HAS_RADIO
// Only start the local telemetry tasks if needed // Only start the local telemetry tasks if needed
if (localPort()) { if (localPort()) {
@ -195,6 +201,7 @@ int32_t TelemetryStart(void)
localChannel.rxTaskHandle); localChannel.rxTaskHandle);
} }
#endif /* ifdef HAS_RADIO */ #endif /* ifdef HAS_RADIO */
// Start the telemetry tasks associated with Radio/USB // Start the telemetry tasks associated with Radio/USB
UAVObjIterate(&registerRadioObject); UAVObjIterate(&registerRadioObject);
@ -231,6 +238,7 @@ void TelemetryInitializeChannel(channelContext *channel)
// Create object queues // Create object queues
channel->queue = xQueueCreate(MAX_QUEUE_SIZE, channel->queue = xQueueCreate(MAX_QUEUE_SIZE,
sizeof(UAVObjEvent)); sizeof(UAVObjEvent));
#if defined(PIOS_TELEM_PRIORITY_QUEUE) #if defined(PIOS_TELEM_PRIORITY_QUEUE)
channel->priorityQueue = xQueueCreate(MAX_QUEUE_SIZE, channel->priorityQueue = xQueueCreate(MAX_QUEUE_SIZE,
sizeof(UAVObjEvent)); sizeof(UAVObjEvent));
@ -283,6 +291,7 @@ int32_t TelemetryInitialize(void)
// Reset link stats // Reset link stats
txErrors = 0; txErrors = 0;
txRetries = 0; txRetries = 0;
#ifdef HAS_RADIO #ifdef HAS_RADIO
// Set channel port handlers // Set channel port handlers
localChannel.getPort = localPort; localChannel.getPort = localPort;
@ -297,8 +306,8 @@ int32_t TelemetryInitialize(void)
// Initialise UAVTalk // Initialise UAVTalk
localChannel.uavTalkCon = UAVTalkInitialize(&transmitLocalData); localChannel.uavTalkCon = UAVTalkInitialize(&transmitLocalData);
} }
#endif /* ifdef HAS_RADIO */ #endif /* ifdef HAS_RADIO */
// Set channel port handlers // Set channel port handlers
radioChannel.getPort = radioPort; radioChannel.getPort = radioPort;
@ -314,6 +323,7 @@ int32_t TelemetryInitialize(void)
} }
MODULE_INITCALL(TelemetryInitialize, TelemetryStart); MODULE_INITCALL(TelemetryInitialize, TelemetryStart);
#ifdef HAS_RADIO #ifdef HAS_RADIO
/** /**
* Register a new object, adds object to local list and connects the queue depending on the object's * Register a new object, adds object to local list and connects the queue depending on the object's
@ -464,6 +474,7 @@ static void updateObject(
UAVObjConnectQueue(obj, channel->priorityQueue, eventMask); UAVObjConnectQueue(obj, channel->priorityQueue, eventMask);
} else } else
#endif /* PIOS_TELEM_PRIORITY_QUEUE */ #endif /* PIOS_TELEM_PRIORITY_QUEUE */
UAVObjConnectQueue(obj, channel->queue, eventMask); UAVObjConnectQueue(obj, channel->queue, eventMask);
} }
@ -589,6 +600,7 @@ static void telemetryTxTask(void *parameters)
/** /**
* Tries to empty the high priority queue before handling any standard priority item * Tries to empty the high priority queue before handling any standard priority item
*/ */
#ifdef PIOS_TELEM_PRIORITY_QUEUE #ifdef PIOS_TELEM_PRIORITY_QUEUE
// empty priority queue, non-blocking // empty priority queue, non-blocking
while (xQueueReceive(channel->priorityQueue, &ev, 0) == pdTRUE) { while (xQueueReceive(channel->priorityQueue, &ev, 0) == pdTRUE) {
@ -611,6 +623,7 @@ static void telemetryTxTask(void *parameters)
processObjEvent(channel, &ev); processObjEvent(channel, &ev);
} }
#endif /* PIOS_TELEM_PRIORITY_QUEUE */ #endif /* PIOS_TELEM_PRIORITY_QUEUE */
} }
} }
@ -655,6 +668,7 @@ static uint32_t localPort()
{ {
return PIOS_COM_TELEM_RF; return PIOS_COM_TELEM_RF;
} }
#endif /* ifdef HAS_RADIO */ #endif /* ifdef HAS_RADIO */
/** /**
@ -816,9 +830,11 @@ static void updateTelemetryStats()
// Get stats // Get stats
UAVTalkGetStats(radioChannel.uavTalkCon, &utalkStats, true); UAVTalkGetStats(radioChannel.uavTalkCon, &utalkStats, true);
#ifdef HAS_RADIO #ifdef HAS_RADIO
UAVTalkAddStats(localChannel.uavTalkCon, &utalkStats, true); UAVTalkAddStats(localChannel.uavTalkCon, &utalkStats, true);
#endif #endif
// Get object data // Get object data
FlightTelemetryStatsGet(&flightStats); FlightTelemetryStatsGet(&flightStats);
GCSTelemetryStatsGet(&gcsStats); GCSTelemetryStatsGet(&gcsStats);