Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giulia Facchi
Skyward Boardcore
Commits
5a5d5b5a
Commit
5a5d5b5a
authored
3 years ago
by
Alberto Nidasio
Browse files
Options
Downloads
Patches
Plain Diff
[Mavlink] Fixed updateQueueStats following SyncPacketQueue fixes
parent
9a49fcb5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shared/drivers/usart/USART.cpp
+0
-1
0 additions, 1 deletion
src/shared/drivers/usart/USART.cpp
src/shared/radio/MavlinkDriver/MavlinkDriver.h
+7
-7
7 additions, 7 deletions
src/shared/radio/MavlinkDriver/MavlinkDriver.h
with
7 additions
and
8 deletions
src/shared/drivers/usart/USART.cpp
+
0
−
1
View file @
5a5d5b5a
...
@@ -330,7 +330,6 @@ USART::USART(USARTType *usart, Baudrate baudrate, unsigned int queueLen)
...
@@ -330,7 +330,6 @@ USART::USART(USARTType *usart, Baudrate baudrate, unsigned int queueLen)
// Enabling the peripheral on the right APB
// Enabling the peripheral on the right APB
ClockUtils
::
enablePeripheralClock
(
usart
);
ClockUtils
::
enablePeripheralClock
(
usart
);
RCC_SYNC
();
// Enabling the usart peripheral
// Enabling the usart peripheral
{
{
...
...
This diff is collapsed.
Click to expand it.
src/shared/radio/MavlinkDriver/MavlinkDriver.h
+
7
−
7
View file @
5a5d5b5a
...
@@ -147,7 +147,7 @@ private:
...
@@ -147,7 +147,7 @@ private:
reinterpret_cast
<
MavlinkDriver
*>
(
arg
)
->
runSender
();
reinterpret_cast
<
MavlinkDriver
*>
(
arg
)
->
runSender
();
}
}
void
updateQueueStats
(
int
dropp
ed
);
void
updateQueueStats
(
bool
append
ed
);
void
updateSenderStats
(
size_t
msgCount
,
bool
sent
);
void
updateSenderStats
(
size_t
msgCount
,
bool
sent
);
...
@@ -224,7 +224,7 @@ bool MavlinkDriver<PktLength, OutQueueSize, MavMsgLength>::start()
...
@@ -224,7 +224,7 @@ bool MavlinkDriver<PktLength, OutQueueSize, MavMsgLength>::start()
}
}
if
(
sndStarted
&&
rcvStarted
)
if
(
sndStarted
&&
rcvStarted
)
LOG_DEBUG
(
logger
,
"S
tart ok (s
ender and receiver
)
\n
"
);
LOG_DEBUG
(
logger
,
"Sender and receiver
started
"
);
return
(
sndStarted
&&
rcvStarted
);
return
(
sndStarted
&&
rcvStarted
);
}
}
...
@@ -249,23 +249,23 @@ bool MavlinkDriver<PktLength, OutQueueSize, MavMsgLength>::enqueueMsg(
...
@@ -249,23 +249,23 @@ bool MavlinkDriver<PktLength, OutQueueSize, MavMsgLength>::enqueueMsg(
int
msgLen
=
mavlink_msg_to_send_buffer
(
msgtempBuf
,
&
msg
);
int
msgLen
=
mavlink_msg_to_send_buffer
(
msgtempBuf
,
&
msg
);
// Append message to the queue
// Append message to the queue
int
dropp
ed
=
outQueue
.
put
(
msgtempBuf
,
msgLen
);
bool
append
ed
=
outQueue
.
put
(
msgtempBuf
,
msgLen
);
// Update stats
// Update stats
updateQueueStats
(
dropp
ed
);
updateQueueStats
(
append
ed
);
// return ok even if a packet was discarded
// return ok even if a packet was discarded
return
dropped
!=
-
1
;
return
appended
;
}
}
template
<
unsigned
int
PktLength
,
unsigned
int
OutQueueSize
,
template
<
unsigned
int
PktLength
,
unsigned
int
OutQueueSize
,
unsigned
int
MavMsgLength
>
unsigned
int
MavMsgLength
>
void
MavlinkDriver
<
PktLength
,
OutQueueSize
,
MavMsgLength
>::
updateQueueStats
(
void
MavlinkDriver
<
PktLength
,
OutQueueSize
,
MavMsgLength
>::
updateQueueStats
(
int
dropp
ed
)
bool
append
ed
)
{
{
miosix
::
Lock
<
miosix
::
FastMutex
>
l
(
mtxStatus
);
miosix
::
Lock
<
miosix
::
FastMutex
>
l
(
mtxStatus
);
if
(
dropped
!=
0
)
if
(
!
appended
)
{
{
LOG_ERR
(
logger
,
"Buffer full, the oldest message has been discarded"
);
LOG_ERR
(
logger
,
"Buffer full, the oldest message has been discarded"
);
status
.
nDroppedPackets
++
;
status
.
nDroppedPackets
++
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment