mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Only schedule overo packets on the NSS line rising to avoid the frame sync
errors we were seeing previously
This commit is contained in:
parent
b7af3c9584
commit
bc075c5d2c
@ -58,7 +58,6 @@ static int32_t packData(uint8_t * data, int32_t length);
|
|||||||
static int32_t transmitData();
|
static int32_t transmitData();
|
||||||
static void transmitDataDone(bool crc_ok, uint8_t crc_val);
|
static void transmitDataDone(bool crc_ok, uint8_t crc_val);
|
||||||
static void registerObject(UAVObjHandle obj);
|
static void registerObject(UAVObjHandle obj);
|
||||||
|
|
||||||
// External variables
|
// External variables
|
||||||
extern int32_t pios_spi_overo_id;
|
extern int32_t pios_spi_overo_id;
|
||||||
|
|
||||||
@ -277,6 +276,7 @@ static void overoSyncTask(void *parameters)
|
|||||||
syncStats.Received = 0;
|
syncStats.Received = 0;
|
||||||
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;
|
||||||
OveroSyncStatsSet(&syncStats);
|
OveroSyncStatsSet(&syncStats);
|
||||||
overosync->failed_objects = 0;
|
overosync->failed_objects = 0;
|
||||||
overosync->sent_bytes = 0;
|
overosync->sent_bytes = 0;
|
||||||
@ -342,7 +342,7 @@ static int32_t packData(uint8_t * data, int32_t length)
|
|||||||
|
|
||||||
xSemaphoreGive(overosync->buffer_lock);
|
xSemaphoreGive(overosync->buffer_lock);
|
||||||
|
|
||||||
// When the NSS line rises while we are packing data then a transaction doesn't start
|
/* // When the NSS line rises while we are packing data then a transaction doesn't start
|
||||||
// because that means we will be here very shortly afterwards (priority of task making that
|
// because that means we will be here very shortly afterwards (priority of task making that
|
||||||
// not always perfectly true) schedule the transaction here.
|
// not always perfectly true) schedule the transaction here.
|
||||||
if (buffer_swap_failed && (PIOS_DELAY_DiffuS(buffer_swap_timeval) < 50)) {
|
if (buffer_swap_failed && (PIOS_DELAY_DiffuS(buffer_swap_timeval) < 50)) {
|
||||||
@ -352,7 +352,7 @@ static int32_t packData(uint8_t * data, int32_t length)
|
|||||||
buffer_swap_failed = false;
|
buffer_swap_failed = false;
|
||||||
too_long++;
|
too_long++;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
<field name="Connected" units="" type="enum" options="False,True" elements="1" default="False"/>
|
<field name="Connected" units="" type="enum" options="False,True" elements="1" default="False"/>
|
||||||
<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="DroppedUpdates" units="" type="uint32" elements="1"/>
|
<field name="DroppedUpdates" 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"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user