Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
19efaca1
Commit
19efaca1
authored
3 years ago
by
Käppler
Browse files
Options
Download
Email Patches
Plain Diff
co2_sensor: Disable state logging by default
parent
a5e847e9
master
develop
experimental/example_for_iotwebconf
senseair_s8
v0.3.0
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.1.0
archive/refactor/src_structure
archive/experimental/wifimanager
archive/experimental/simple
archive/experimental/save_lora_session
archive/experimental/save_config
archive/experimental/ota
archive/experimental/binary_clock
archive/experimental/autoconnect
archive/dev/debugcalib
1 merge request
!4
co2_sensor: Introduce states
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ampel-firmware/co2_sensor.cpp
+7
-4
ampel-firmware/co2_sensor.cpp
with
7 additions
and
4 deletions
+7
-4
ampel-firmware/co2_sensor.cpp
+
7
-
4
View file @
19efaca1
...
...
@@ -15,6 +15,7 @@ namespace config {
const
float
temperature_offset
=
-
3.0
;
// [K] Temperature measured by sensor is usually at least 3K too high.
#endif
bool
auto_calibrate_sensor
=
AUTO_CALIBRATE_SENSOR
;
// [true / false]
const
bool
debug_sensor_states
=
false
;
// If true, log state transitions over serial console
}
namespace
sensor
{
...
...
@@ -172,10 +173,12 @@ namespace sensor {
void
switchState
(
state
new_state
)
{
if
(
new_state
==
current_state
)
return
;
if
(
config
::
debug_sensor_states
)
{
Serial
.
print
(
F
(
"Changing sensor state: "
));
Serial
.
print
(
state_names
[
current_state
]);
Serial
.
print
(
" -> "
);
Serial
.
println
(
state_names
[
new_state
]);
}
current_state
=
new_state
;
}
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets