Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
353caec1
Commit
353caec1
authored
7 years ago
by
Beat Küng
Committed by
Lorenz Meier
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
temperature_calibration: check if no sensor is found
parent
6b974701
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/events/temperature_calibration/common.h
+8
-5
8 additions, 5 deletions
src/modules/events/temperature_calibration/common.h
src/modules/events/temperature_calibration/task.cpp
+7
-1
7 additions, 1 deletion
src/modules/events/temperature_calibration/task.cpp
with
15 additions
and
6 deletions
src/modules/events/temperature_calibration/common.h
+
8
−
5
View file @
353caec1
...
...
@@ -49,6 +49,7 @@
#define TC_ERROR_INITIAL_TEMP_TOO_HIGH 110 ///< starting temperature was above the configured allowed temperature
#define TC_ERROR_COMMUNICATION 112 ///< no sensors found
/**
* Base class for temperature calibration types with abstract methods (for all different sensor types)
...
...
@@ -66,6 +67,7 @@ public:
* check & update new sensor data.
* @return progress in range [0, 100], 110 when finished, <0 on error,
* -TC_ERROR_INITIAL_TEMP_TOO_HIGH if starting temperature is too hot
* -TC_ERROR_COMMUNICATION if no sensors found
*/
virtual
int
update
()
=
0
;
...
...
@@ -129,14 +131,15 @@ public:
{
int
num_not_complete
=
0
;
if
(
_num_sensor_instances
==
0
)
{
return
-
TC_ERROR_COMMUNICATION
;
}
for
(
unsigned
uorb_index
=
0
;
uorb_index
<
_num_sensor_instances
;
uorb_index
++
)
{
int
status
=
update_sensor_instance
(
_data
[
uorb_index
],
_sensor_subs
[
uorb_index
]);
if
(
status
==
-
1
)
{
return
-
1
;
}
else
if
(
status
==
-
TC_ERROR_INITIAL_TEMP_TOO_HIGH
)
{
return
-
TC_ERROR_INITIAL_TEMP_TOO_HIGH
;
if
(
status
<
0
)
{
return
status
;
}
num_not_complete
+=
status
;
...
...
This diff is collapsed.
Click to expand it.
src/modules/events/temperature_calibration/task.cpp
+
7
−
1
View file @
353caec1
...
...
@@ -227,7 +227,13 @@ void TemperatureCalibration::task_main()
for
(
int
i
=
0
;
i
<
num_calibrators
;
++
i
)
{
ret
=
calibrators
[
i
]
->
update
();
if
(
ret
==
-
TC_ERROR_INITIAL_TEMP_TOO_HIGH
)
{
if
(
ret
==
-
TC_ERROR_COMMUNICATION
)
{
abort_calibration
=
true
;
PX4_ERR
(
"Calibration won't start - sensor bad or communication error"
);
_force_task_exit
=
true
;
break
;
}
else
if
(
ret
==
-
TC_ERROR_INITIAL_TEMP_TOO_HIGH
)
{
abort_calibration
=
true
;
PX4_ERR
(
"Calibration won't start - sensor temperature too high"
);
_force_task_exit
=
true
;
...
...
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