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
6baf3b30
Commit
6baf3b30
authored
Apr 17, 2021
by
Eric Duminil
Browse files
Almost done with sensor commands
parent
579440cb
Changes
4
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/co2_sensor.cpp
View file @
6baf3b30
...
...
@@ -80,6 +80,7 @@ namespace sensor {
sensor_commands
::
defineCallback
(
"reset"
,
[]()
{
ESP
.
restart
();
},
" (Restarts the sensor)"
);
sensor_commands
::
defineCallback
(
"night_mode"
,
led_effects
::
toggleNightMode
,
" (Toggles night mode on/off)"
);
}
//NOTE: should timer deviation be used to adjust measurement_timestep?
...
...
ampel-firmware/csv_writer.cpp
View file @
6baf3b30
...
...
@@ -118,15 +118,6 @@ namespace csv_writer {
Serial
.
println
();
sensor_commands
::
defineIntCallback
(
"csv"
,
setCSVinterval
,
" 60 (Sets CSV writing interval, in s)"
);
sensor_commands
::
defineIntCallback
(
"double"
,
[](
int32_t
x
)
{
Serial
.
print
(
"2 * "
);
Serial
.
print
(
x
);
Serial
.
print
(
" = "
);
Serial
.
println
(
2
*
x
);
},
" (Say Hello;)"
);
sensor_commands
::
defineCallback
(
"hello"
,
[]()
{
Serial
.
println
(
"SAY HELLO"
);
},
" (Say Hello;)"
);
sensor_commands
::
defineCallback
(
"format_filesystem"
,
formatFilesystem
,
" (Deletes the whole filesystem)"
);
}
...
...
ampel-firmware/mqtt.cpp
View file @
6baf3b30
...
...
@@ -84,13 +84,6 @@ namespace mqtt {
sensor_commands
::
run
(
messageString
.
c_str
());
delay
(
50
);
led_effects
::
onBoardLEDOff
();
return
;
//TODO: Move this logic to a separate class, which could be used by Serial/MQTT/WebServer
if
(
messageString
==
"night_mode"
)
{
led_effects
::
toggleNightMode
();
}
}
void
reconnect
()
{
...
...
ampel-firmware/sensor_commands.cpp
View file @
6baf3b30
...
...
@@ -99,6 +99,7 @@ namespace sensor_commands {
Serial
.
println
(
")"
);
callbacks
[
i
].
intFunction
(
argument
);
}
else
{
Serial
.
println
();
callbacks
[
i
].
voidFunction
();
}
return
;
...
...
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