mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
Use a bigger event queue for overo logging to avoid event system warnings, and
add code to shortcircuit formatting a packet if it will not fit.
This commit is contained in:
parent
e82323af32
commit
8c8224c122
@ -37,7 +37,7 @@
|
||||
|
||||
// Private constants
|
||||
#define OVEROSYNC_PACKET_SIZE 1024
|
||||
#define MAX_QUEUE_SIZE 10
|
||||
#define MAX_QUEUE_SIZE 40
|
||||
#define STACK_SIZE_BYTES 4096
|
||||
#define TASK_PRIORITY (tskIDLE_PRIORITY + 0)
|
||||
|
||||
@ -235,8 +235,15 @@ static void overoSyncTask(void *parameters)
|
||||
while (1) {
|
||||
// Wait for queue message
|
||||
if (xQueueReceive(queue, &ev, portMAX_DELAY) == pdTRUE) {
|
||||
// Process event. This calls transmitData
|
||||
UAVTalkSendObject(uavTalkCon, ev.obj, ev.instId, false, 0);
|
||||
|
||||
// Check it will fit before packetizing
|
||||
if ((overosync->write_pointer + UAVObjGetNumBytes(ev.obj) + 12) >=
|
||||
sizeof(overosync->transactions[overosync->loading_transaction_id].tx_buffer)) {
|
||||
overosync->failed_objects ++;
|
||||
} else {
|
||||
// Process event. This calls transmitData
|
||||
UAVTalkSendObject(uavTalkCon, ev.obj, ev.instId, false, 0);
|
||||
}
|
||||
|
||||
updateTime = xTaskGetTickCount();
|
||||
if(((portTickType) (updateTime - lastUpdateTime)) > 1000) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user