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
Model registry
Analyze
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
Avionics
Software Development
Skyward Boardcore
Commits
6cb39ba0
Commit
6cb39ba0
authored
1 year ago
by
Davide Mor
Browse files
Options
Downloads
Patches
Plain Diff
[Sensors] Fixed improper locking behaviour in Sensor
parent
8d533da0
Branches
Branches containing commit
No related tags found
1 merge request
!270
[Sensors] Fixed improper locking behaviour in Sensor
Pipeline
#8896
passed
1 year ago
Stage: lint
Stage: build
Stage: test
Stage: documentation
Stage: deploy
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shared/sensors/Sensor.h
+1
-1
1 addition, 1 deletion
src/shared/sensors/Sensor.h
src/tests/test-sensormanager.cpp
+2
-2
2 additions, 2 deletions
src/tests/test-sensormanager.cpp
with
3 additions
and
3 deletions
src/shared/sensors/Sensor.h
+
1
−
1
View file @
6cb39ba0
...
@@ -120,7 +120,7 @@ public:
...
@@ -120,7 +120,7 @@ public:
/**
/**
* @return last available sample from this sensor
* @return last available sample from this sensor
*/
*/
virtual
const
Data
&
getLastSample
()
virtual
Data
getLastSample
()
{
{
miosix
::
Lock
<
miosix
::
FastMutex
>
l
(
mutex
);
miosix
::
Lock
<
miosix
::
FastMutex
>
l
(
mutex
);
return
lastSample
;
return
lastSample
;
...
...
This diff is collapsed.
Click to expand it.
src/tests/test-sensormanager.cpp
+
2
−
2
View file @
6cb39ba0
...
@@ -81,7 +81,7 @@ public:
...
@@ -81,7 +81,7 @@ public:
SensorData
sampleImpl
()
{
return
SensorData
();
}
SensorData
sampleImpl
()
{
return
SensorData
();
}
const
SensorData
&
getLastSample
()
override
SensorData
getLastSample
()
override
{
{
this
->
lastSample
=
originalSensor
->
getLastSample
();
this
->
lastSample
=
originalSensor
->
getLastSample
();
this
->
lastSample
.
pressure
+=
offset
;
this
->
lastSample
.
pressure
+=
offset
;
...
@@ -163,7 +163,7 @@ public:
...
@@ -163,7 +163,7 @@ public:
return
sensor
->
getFifoElement
(
index
);
return
sensor
->
getFifoElement
(
index
);
}
}
const
FIFOData
&
getLastSample
()
override
FIFOData
getLastSample
()
override
{
{
if
(
index
<
FifoSize
-
1
)
if
(
index
<
FifoSize
-
1
)
{
{
...
...
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