1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Update the module and overosyncstats to track buffer underruns

This commit is contained in:
James Cotton 2012-07-17 17:21:51 -05:00
parent 2f64124da8
commit 4306afa841
3 changed files with 8 additions and 4 deletions

View File

@ -55,7 +55,7 @@ static bool overoEnabled;
// Private functions // Private functions
static void overoSyncTask(void *parameters); static void overoSyncTask(void *parameters);
static int32_t packData(uint8_t * data, int32_t length); static int32_t packData(uint8_t * data, int32_t length);
static void transmitDataDone(); static void transmitDataDone(uint32_t error_counter);
static void registerObject(UAVObjHandle obj); static void registerObject(UAVObjHandle obj);
struct dma_transaction { struct dma_transaction {
@ -75,6 +75,7 @@ struct overosync {
uint32_t failed_objects; uint32_t failed_objects;
uint32_t received_objects; uint32_t received_objects;
uint32_t framesync_error; uint32_t framesync_error;
uint32_t underrun_error;
}; };
struct overosync *overosync; struct overosync *overosync;
@ -218,6 +219,7 @@ static void overoSyncTask(void *parameters)
syncStats.DroppedUpdates = overosync->failed_objects; syncStats.DroppedUpdates = overosync->failed_objects;
syncStats.FramesyncErrors = overosync->framesync_error; syncStats.FramesyncErrors = overosync->framesync_error;
syncStats.Packets = overosync->packets; syncStats.Packets = overosync->packets;
syncStats.UnderrunErrors = overosync->underrun_error;
OveroSyncStatsSet(&syncStats); OveroSyncStatsSet(&syncStats);
overosync->failed_objects = 0; overosync->failed_objects = 0;
overosync->sent_bytes = 0; overosync->sent_bytes = 0;
@ -268,7 +270,7 @@ static int32_t packData(uint8_t * data, int32_t length)
/** /**
* Callback from the overo spi driver at the end of each packet * Callback from the overo spi driver at the end of each packet
*/ */
static void transmitDataDone() static void transmitDataDone(uint32_t error_counter)
{ {
uint8_t *tx_buffer, *rx_buffer; uint8_t *tx_buffer, *rx_buffer;
@ -298,6 +300,7 @@ static void transmitDataDone()
memset(overosync->transactions[overosync->loading_transaction_id].tx_buffer, 0xff, memset(overosync->transactions[overosync->loading_transaction_id].tx_buffer, 0xff,
sizeof(overosync->transactions[overosync->loading_transaction_id].tx_buffer)); sizeof(overosync->transactions[overosync->loading_transaction_id].tx_buffer));
overosync->write_pointer = 0; overosync->write_pointer = 0;
overosync->underrun_error = error_counter;
} }
/** /**

2
overo

@ -1 +1 @@
Subproject commit 704c7b291a9effd3a9cf189e5fef167c598d79bf Subproject commit a66f84c87c87a0ceb8b12e8efaacc7445c14b8f4

View File

@ -5,6 +5,7 @@
<field name="Send" units="B/s" type="uint32" elements="1"/> <field name="Send" units="B/s" type="uint32" elements="1"/>
<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="UnderrunErrors" 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"/> <field name="Packets" units="" type="uint32" elements="1"/>
<access gcs="readwrite" flight="readwrite"/> <access gcs="readwrite" flight="readwrite"/>