mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
Clean up some cruft from Overo module and add a packet counter
This commit is contained in:
parent
db27653859
commit
9c91436428
@ -67,9 +67,8 @@ struct overosync {
|
|||||||
struct dma_transaction transactions[2];
|
struct dma_transaction transactions[2];
|
||||||
uint32_t active_transaction_id;
|
uint32_t active_transaction_id;
|
||||||
uint32_t loading_transaction_id;
|
uint32_t loading_transaction_id;
|
||||||
xSemaphoreHandle transaction_lock;
|
|
||||||
xSemaphoreHandle buffer_lock;
|
xSemaphoreHandle buffer_lock;
|
||||||
volatile bool transaction_done;
|
uint32_t packets;
|
||||||
uint32_t sent_bytes;
|
uint32_t sent_bytes;
|
||||||
uint32_t write_pointer;
|
uint32_t write_pointer;
|
||||||
uint32_t sent_objects;
|
uint32_t sent_objects;
|
||||||
@ -132,10 +131,6 @@ int32_t OveroSyncStart(void)
|
|||||||
if(overosync == NULL)
|
if(overosync == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
overosync->transaction_lock = xSemaphoreCreateMutex();
|
|
||||||
if(overosync->transaction_lock == NULL)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
overosync->buffer_lock = xSemaphoreCreateMutex();
|
overosync->buffer_lock = xSemaphoreCreateMutex();
|
||||||
if(overosync->buffer_lock == NULL)
|
if(overosync->buffer_lock == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
@ -145,6 +140,7 @@ int32_t OveroSyncStart(void)
|
|||||||
overosync->write_pointer = 0;
|
overosync->write_pointer = 0;
|
||||||
overosync->sent_bytes = 0;
|
overosync->sent_bytes = 0;
|
||||||
overosync->framesync_error = 0;
|
overosync->framesync_error = 0;
|
||||||
|
overosync->packets = 0;
|
||||||
|
|
||||||
// Process all registered objects and connect queue for updates
|
// Process all registered objects and connect queue for updates
|
||||||
UAVObjIterate(®isterObject);
|
UAVObjIterate(®isterObject);
|
||||||
@ -188,7 +184,6 @@ static void overoSyncTask(void *parameters)
|
|||||||
UAVObjEvent ev;
|
UAVObjEvent ev;
|
||||||
|
|
||||||
// Kick off SPI transfers (once one is completed another will automatically transmit)
|
// Kick off SPI transfers (once one is completed another will automatically transmit)
|
||||||
overosync->transaction_done = true;
|
|
||||||
overosync->sent_objects = 0;
|
overosync->sent_objects = 0;
|
||||||
overosync->failed_objects = 0;
|
overosync->failed_objects = 0;
|
||||||
overosync->received_objects = 0;
|
overosync->received_objects = 0;
|
||||||
@ -222,6 +217,7 @@ static void overoSyncTask(void *parameters)
|
|||||||
syncStats.Connected = syncStats.Send > 500 ? OVEROSYNCSTATS_CONNECTED_TRUE : OVEROSYNCSTATS_CONNECTED_FALSE;
|
syncStats.Connected = syncStats.Send > 500 ? OVEROSYNCSTATS_CONNECTED_TRUE : OVEROSYNCSTATS_CONNECTED_FALSE;
|
||||||
syncStats.DroppedUpdates = overosync->failed_objects;
|
syncStats.DroppedUpdates = overosync->failed_objects;
|
||||||
syncStats.FramesyncErrors = overosync->framesync_error;
|
syncStats.FramesyncErrors = overosync->framesync_error;
|
||||||
|
syncStats.Packets = overosync->packets;
|
||||||
OveroSyncStatsSet(&syncStats);
|
OveroSyncStatsSet(&syncStats);
|
||||||
overosync->failed_objects = 0;
|
overosync->failed_objects = 0;
|
||||||
overosync->sent_bytes = 0;
|
overosync->sent_bytes = 0;
|
||||||
@ -281,7 +277,7 @@ static void transmitDataDone()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
overosync->transaction_done = false;
|
overosync->packets++;
|
||||||
|
|
||||||
// Swap buffers
|
// Swap buffers
|
||||||
overosync->active_transaction_id = overosync->loading_transaction_id;
|
overosync->active_transaction_id = overosync->loading_transaction_id;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<field name="Received" units="B/s" type="uint32" elements="1"/>
|
<field name="Received" units="B/s" type="uint32" elements="1"/>
|
||||||
<field name="FramesyncErrors" units="count" type="uint32" elements="1"/>
|
<field name="FramesyncErrors" units="count" type="uint32" elements="1"/>
|
||||||
<field name="DroppedUpdates" units="" type="uint32" elements="1"/>
|
<field name="DroppedUpdates" units="" type="uint32" elements="1"/>
|
||||||
|
<field name="Packets" units="" type="uint32" elements="1"/>
|
||||||
<access gcs="readwrite" flight="readwrite"/>
|
<access gcs="readwrite" flight="readwrite"/>
|
||||||
<telemetrygcs acked="false" updatemode="manual" period="0"/>
|
<telemetrygcs acked="false" updatemode="manual" period="0"/>
|
||||||
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
|
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user