Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
c6139baf
Commit
c6139baf
authored
Apr 29, 2021
by
Käppler
Browse files
co2_sensor: Drop unused state 'CALIBRATION'
parent
fe023428
Changes
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/co2_sensor.cpp
View file @
c6139baf
...
@@ -36,7 +36,6 @@ namespace sensor {
...
@@ -36,7 +36,6 @@ namespace sensor {
* INVALID -> sensor does output invalid CO2 measurements (== 0 ppm)
* INVALID -> sensor does output invalid CO2 measurements (== 0 ppm)
* NEEDS_CALIBRATION -> sensor measurements are too low (< 250 ppm)
* NEEDS_CALIBRATION -> sensor measurements are too low (< 250 ppm)
* PREPARE_CALIBRATION -> forced calibration was initiated, waiting for stable measurements
* PREPARE_CALIBRATION -> forced calibration was initiated, waiting for stable measurements
* CALIBRATION -> the sensor does calibrate itself
*/
*/
enum
state
{
enum
state
{
INITIAL
,
INITIAL
,
...
@@ -45,8 +44,7 @@ namespace sensor {
...
@@ -45,8 +44,7 @@ namespace sensor {
INVALID
,
INVALID
,
NEEDS_CALIBRATION
,
NEEDS_CALIBRATION
,
PREPARE_CALIBRATION_UNSTABLE
,
PREPARE_CALIBRATION_UNSTABLE
,
PREPARE_CALIBRATION_STABLE
,
PREPARE_CALIBRATION_STABLE
CALIBRATION
};
};
const
char
*
state_names
[]
=
{
const
char
*
state_names
[]
=
{
"INITIAL"
,
"INITIAL"
,
...
@@ -55,8 +53,7 @@ namespace sensor {
...
@@ -55,8 +53,7 @@ namespace sensor {
"INVALID"
,
"INVALID"
,
"NEEDS_CALIBRATION"
,
"NEEDS_CALIBRATION"
,
"PREPARE_CALIBRATION_UNSTABLE"
,
"PREPARE_CALIBRATION_UNSTABLE"
,
"PREPARE_CALIBRATION_STABLE"
,
"PREPARE_CALIBRATION_STABLE"
};
"CALIBRATION"
};
state
current_state
=
INITIAL
;
state
current_state
=
INITIAL
;
void
switchState
(
state
);
void
switchState
(
state
);
...
@@ -172,7 +169,6 @@ namespace sensor {
...
@@ -172,7 +169,6 @@ namespace sensor {
}
}
void
calibrateAndRestart
()
{
void
calibrateAndRestart
()
{
switchState
(
CALIBRATION
);
Serial
.
print
(
F
(
"Calibrating SCD30 now..."
));
Serial
.
print
(
F
(
"Calibrating SCD30 now..."
));
scd30
.
setAltitudeCompensation
(
config
::
altitude_above_sea_level
);
scd30
.
setAltitudeCompensation
(
config
::
altitude_above_sea_level
);
scd30
.
setForcedRecalibrationFactor
(
config
::
co2_calibration_level
);
scd30
.
setForcedRecalibrationFactor
(
config
::
co2_calibration_level
);
...
@@ -269,8 +265,6 @@ namespace sensor {
...
@@ -269,8 +265,6 @@ namespace sensor {
case
PREPARE_CALIBRATION_STABLE
:
case
PREPARE_CALIBRATION_STABLE
:
led_effects
::
showWaitingLED
(
color
::
green
);
led_effects
::
showWaitingLED
(
color
::
green
);
break
;
break
;
case
CALIBRATION
:
// Nothing to do, will restart soon.
break
;
default:
default:
Serial
.
println
(
F
(
"Encountered unknown sensor state"
));
// This should not happen.
Serial
.
println
(
F
(
"Encountered unknown sensor state"
));
// This should not happen.
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment