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
9d1c951d
Commit
9d1c951d
authored
3 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Some refactor
parent
188a0bf3
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
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ampel-firmware/co2_sensor.cpp
+0
-4
ampel-firmware/co2_sensor.cpp
ampel-firmware/util.cpp
+10
-5
ampel-firmware/util.cpp
ampel-firmware/util.h
+3
-1
ampel-firmware/util.h
with
13 additions
and
10 deletions
+13
-10
ampel-firmware/co2_sensor.cpp
+
0
-
4
View file @
9d1c951d
...
@@ -79,10 +79,6 @@ namespace sensor {
...
@@ -79,10 +79,6 @@ namespace sensor {
sensor_console
::
defineIntCommand
(
"calibrate!"
,
calibrateSensorRightNow
,
sensor_console
::
defineIntCommand
(
"calibrate!"
,
calibrateSensorRightNow
,
" 600 (Calibrates right now, to given ppm)"
);
" 600 (Calibrates right now, to given ppm)"
);
sensor_console
::
defineIntCommand
(
"auto_calibrate"
,
setAutoCalibration
,
" 0/1 (Disables/enables autocalibration)"
);
sensor_console
::
defineIntCommand
(
"auto_calibrate"
,
setAutoCalibration
,
" 0/1 (Disables/enables autocalibration)"
);
sensor_console
::
defineCommand
(
"reset"
,
[]()
{
ESP
.
restart
();
},
" (Restarts the sensor)"
);
}
}
//NOTE: should timer deviation be used to adjust measurement_timestep?
//NOTE: should timer deviation be used to adjust measurement_timestep?
...
...
This diff is collapsed.
Click to expand it.
ampel-firmware/util.cpp
+
10
-
5
View file @
9d1c951d
...
@@ -51,14 +51,19 @@ namespace ntp {
...
@@ -51,14 +51,19 @@ namespace ntp {
}
}
}
}
Ampel
::
Ampel
()
:
void
Ampel
::
showFreeSpace
()
{
sensorId
(
"ESP"
+
macToID
()),
max_loop_duration
(
0
)
{
sensor_console
::
defineIntCommand
(
"set_time"
,
ntp
::
setLocalTime
,
" 1618829570 (Sets time to the given UNIX time)"
);
sensor_console
::
defineCommand
(
"free"
,
[]()
{
Serial
.
print
(
F
(
"Free heap space : "
));
Serial
.
print
(
F
(
"Free heap space : "
));
Serial
.
print
(
get_free_heap_size
());
Serial
.
print
(
get_free_heap_size
());
Serial
.
println
(
F
(
" bytes."
));
Serial
.
println
(
F
(
" bytes."
));
},
" (Displays available heap space)"
);
}
Ampel
::
Ampel
()
:
sensorId
(
"ESP"
+
macToID
()),
max_loop_duration
(
0
)
{
sensor_console
::
defineIntCommand
(
"set_time"
,
ntp
::
setLocalTime
,
" 1618829570 (Sets time to the given UNIX time)"
);
sensor_console
::
defineCommand
(
"free"
,
Ampel
::
showFreeSpace
,
" (Displays available heap space)"
);
sensor_console
::
defineCommand
(
"reset"
,
[]()
{
ESP
.
restart
();
},
" (Restarts the sensor)"
);
}
}
Ampel
ampel
;
Ampel
ampel
;
This diff is collapsed.
Click to expand it.
ampel-firmware/util.h
+
3
-
1
View file @
9d1c951d
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include
"src/lib/NTPClient-master/NTPClient.h"
// NTP
#include
"src/lib/NTPClient-master/NTPClient.h"
// NTP
#if defined(ESP8266)
#if defined(ESP8266)
# define BOARD "ESP8266"
# define BOARD "ESP8266"
//TODO: Move to ampel.board?
# include <ESP8266WiFi.h> // required to get MAC address
# include <ESP8266WiFi.h> // required to get MAC address
# define get_free_heap_size() system_get_free_heap_size()
# define get_free_heap_size() system_get_free_heap_size()
#elif defined(ESP32)
#elif defined(ESP32)
...
@@ -37,6 +37,8 @@ namespace util {
...
@@ -37,6 +37,8 @@ namespace util {
}
}
}
}
class
Ampel
{
class
Ampel
{
private:
static
void
showFreeSpace
();
public:
public:
const
String
sensorId
;
const
String
sensorId
;
uint32_t
max_loop_duration
;
uint32_t
max_loop_duration
;
...
...
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