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
Show whitespace changes
Inline
Side-by-side
ampel-firmware/co2_sensor.cpp
View file @
c6139baf
...
...
@@ -36,7 +36,6 @@ namespace sensor {
* INVALID -> sensor does output invalid CO2 measurements (== 0 ppm)
* NEEDS_CALIBRATION -> sensor measurements are too low (< 250 ppm)
* PREPARE_CALIBRATION -> forced calibration was initiated, waiting for stable measurements
* CALIBRATION -> the sensor does calibrate itself
*/
enum
state
{
INITIAL
,
...
...
@@ -45,8 +44,7 @@ namespace sensor {
INVALID
,
NEEDS_CALIBRATION
,
PREPARE_CALIBRATION_UNSTABLE
,
PREPARE_CALIBRATION_STABLE
,
CALIBRATION
PREPARE_CALIBRATION_STABLE
};
const
char
*
state_names
[]
=
{
"INITIAL"
,
...
...
@@ -55,8 +53,7 @@ namespace sensor {
"INVALID"
,
"NEEDS_CALIBRATION"
,
"PREPARE_CALIBRATION_UNSTABLE"
,
"PREPARE_CALIBRATION_STABLE"
,
"CALIBRATION"
};
"PREPARE_CALIBRATION_STABLE"
};
state
current_state
=
INITIAL
;
void
switchState
(
state
);
...
...
@@ -172,7 +169,6 @@ namespace sensor {
}
void
calibrateAndRestart
()
{
switchState
(
CALIBRATION
);
Serial
.
print
(
F
(
"Calibrating SCD30 now..."
));
scd30
.
setAltitudeCompensation
(
config
::
altitude_above_sea_level
);
scd30
.
setForcedRecalibrationFactor
(
config
::
co2_calibration_level
);
...
...
@@ -269,8 +265,6 @@ namespace sensor {
case
PREPARE_CALIBRATION_STABLE
:
led_effects
::
showWaitingLED
(
color
::
green
);
break
;
case
CALIBRATION
:
// Nothing to do, will restart soon.
break
;
default:
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